Because `Array.prototype._each` (defined by Prototype.js) is bound to
custom `each` implementation when native `Array.prototype.forEach` is
unavailable (e.g. in older versions of Firefox). That custom
implementation currently looks like:
function each(iterator) {
for (var i = 0, length = this.length; i < length; i++)
iterator(this[i]);
}
while, to be consistent with `forEach`, it would need to look like:
function each(iterator, context) {
for (var i = 0, length = this.length; i < length; i++)
iterator.call(context, this[i], i, this);
> Because `Array.prototype._each` (defined by Prototype.js) is bound to
> custom `each` implementation when native `Array.prototype.forEach` is
> unavailable (e.g. in older versions of Firefox). That custom
> implementation currently looks like:
> function each(iterator) {
> for (var i = 0, length = this.length; i < length; i++)
> iterator(this[i]);
> }
> while, to be consistent with `forEach`, it would need to look like:
> function each(iterator, context) {
> for (var i = 0, length = this.length; i < length; i++)
> iterator.call(context, this[i], i, this);