Node.js examples for Array:Array Operation
Increments and multiply all elements in the array and returns
Array.prototype.increment = function(num) { for(i=0;i<this.length;i++) this[i]+=num;//w ww . j av a2 s . c om return this; }; Array.prototype.mult = function(num) { for(i=0;i<this.length;i++) this[i]=this[i]*num; return this; };