UNPKG

es-iterator-helpers

Version:

An ESnext spec-compliant iterator helpers shim/polyfill/replacement that works as far down as ES3.

19 lines (13 loc) 427 B
'use strict'; var define = require('define-properties'); var getPolyfill = require('./polyfill'); var $IteratorPrototype = require('../Iterator.prototype/implementation'); module.exports = function shimIteratorPrototypeForEach() { var polyfill = getPolyfill(); define( $IteratorPrototype, { forEach: polyfill }, { forEach: function () { return $IteratorPrototype.forEach !== polyfill; } } ); return polyfill; };