Array.prototype.each = function (fnc) { var leng = this.length; for(var i = 0;i< leng;i++) { fnc.call(this[i]); } };