Node.js examples for Array:Search
Find array by key
Array.prototype.findByKey = function( key, value ) { for ( var i = 0, n = this.length; i < n; i++ ) { if ( this[ i ][ key ] === value ) return this[ i ]; }/*from w ww .j ava2 s . co m*/ return false; };