Array.prototype.each = function (fn) {
try {
this.i || (this.i = 0);
if (this.length > 0 && fn.constructor === Function) {
while (this.i < this.length) {
var item = this[this.i];
if (e && this.constructor === Array) {
e.each(fn);
} else {
//fn(item);
fn.apply(item, [item]);
}
this.i++;
}
this.i = null;
}
} catch (e) {
}
return this;
};