Javascript Number times(args)

Description

Javascript Number times(args)


Number.prototype.times = function(args) {
  var args = Array.prototype.slice.apply(arguments);
  for(var i = 0; i < this; i++) {
      args[0].apply(null, args.slice(1))
  }//from   w ww .jav a  2  s  . com
};



PreviousNext

Related