Javascript Array all(predicate)
/*My desicion*///from w ww . j a v a 2s . co m Array.prototype.all = function(predicate){ for (var i = 0; i < this.length; i++){ if (!predicate(this[i])) { return false } } return true }
Array.prototype.all = function (predicate) { return !this.any(function(x){ return !predicate(x); }); };