Node.js examples for Array:Array Operation
Apply predicate for each array
Array.prototype.where = function (predicate) { var ret = []; for (var i = 0; i < this.length; ++i) { if (predicate(this[i], i)) ret.push(this[i]);// w w w . j ava 2s . c o m } return ret; };