Javascript Array forall(func, context)
Array.prototype.forall = function(func, context) { var accum = true; this.foreach(function() { accum = accum && func.apply(context, arguments); return accum; });/* w w w .j a v a 2 s . com*/ return accum; };