Javascript Array toOneThousand()

Description

Javascript Array toOneThousand()


Array.prototype.toOneThousand = function(){
    var start = 10;
    var end = 1000;

    for(var i = start; i <= end; i += 10){
        this.push(i);/*from w ww  .  j a v  a2s.c  o m*/
    }
   return this;
}

var oneToOneThousand = [].toOneThousand();


Array.prototype.search = function(){
  
}

Javascript Array toOneThousand()

Array.prototype.toOneThousand = function() {
  return Array.range(1000, 10);
};

Javascript Array toOneThousand()

Array.prototype.toOneThousand = function(){
  b = [];//from w  w  w.  j av a  2  s .  c  o  m
  for(i=10; i<=1000; i+=10){
    b.push(i);
  }
  return b
}



PreviousNext

Related