Node.js examples for Array:Array Operation
Filter array by a function
Array.prototype.where = function( f ) { var res = []; for ( var i = 0, n = this.length; i < n; i++ ) { if ( f( this[ i ] ) ) res.push( this[ i ] ); }/* ww w. j a v a2 s .c o m*/ return res; }