Skip to content

Commit

Permalink
Better polyfill for forEach in oldIE. See #8865.
Browse files Browse the repository at this point in the history
  • Loading branch information
TorsteinHonsi committed Sep 5, 2018
1 parent 0ee7dab commit 7078963
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion js/modules/oldie.src.js
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,10 @@ if (!Array.prototype.forEach) {
var i = 0,
len = this.length;
for (; i < len; i++) {
if (fn.call(ctx, this[i], i, this) === false) {
if (
this[i] !== undefined && // added check
fn.call(ctx, this[i], i, this) === false
) {
return i;
}
}
Expand Down

0 comments on commit 7078963

Please sign in to comment.