10 lines
459 B
JavaScript
10 lines
459 B
JavaScript
|
'use strict';
|
||
|
var $forEach = require('../internals/array-iteration').forEach;
|
||
|
var sloppyArrayMethod = require('../internals/sloppy-array-method');
|
||
|
|
||
|
// `Array.prototype.forEach` method implementation
|
||
|
// https://tc39.github.io/ecma262/#sec-array.prototype.foreach
|
||
|
module.exports = sloppyArrayMethod('forEach') ? function forEach(callbackfn /* , thisArg */) {
|
||
|
return $forEach(this, callbackfn, arguments.length > 1 ? arguments[1] : undefined);
|
||
|
} : [].forEach;
|