Node.js examples for Array:Search
Implement Array search method
Array.prototype.indexOf = function( value ) { for ( var i = 0 ; i < this.length ; i++ ) {// ww w.j a va 2s .co m if ( this[i] == value ) return i ; } return -1 ; }