UNPKG

459 BJavaScriptView Raw
1'use strict';
2var $forEach = require('../internals/array-iteration').forEach;
3var sloppyArrayMethod = require('../internals/sloppy-array-method');
4
5// `Array.prototype.forEach` method implementation
6// https://tc39.github.io/ecma262/#sec-array.prototype.foreach
7module.exports = sloppyArrayMethod('forEach') ? function forEach(callbackfn /* , thisArg */) {
8 return $forEach(this, callbackfn, arguments.length > 1 ? arguments[1] : undefined);
9} : [].forEach;