Node.js examples for Array:Search
Get lowest value on an array
/**/*from w w w . j a v a2 s .c o m*/ * Get lowest value on an array */ Array.prototype.lowest = function() { var lowest_value = this[0]; for(var i=1; i<this.length; i++) { if(this[i] < lowest_value) { lowest_value = this[i]; } } return lowest_value; }