UNPKG

moltres-utils

Version:
41 lines (35 loc) 1.07 kB
"use strict"; require("core-js/modules/es6.object.define-property"); Object.defineProperty(exports, "__esModule", { value: true }); exports.default = void 0; require("core-js/modules/web.dom.iterable"); require("core-js/modules/es6.array.for-each"); /** * This method executes a provided function once for each array element. * * See [Array.prototype.forEach()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/forEach) for more information * * @function * @since v0.0.18 * @category lang * @param {array} array The array to iterate over. * @param {function} fn The function to execute for each element * @returns {array} The original array * @example * * const items = ['item1', 'item2', 'item3'] * const copy = [] * * for (let i=0; i<items.length; i++) { * copy.push(items[i]) * } * //=> ['item1', 'item2', 'item3'] */ var arrayForEach = function arrayForEach(array, fn) { return array.forEach(fn); }; var _default = arrayForEach; exports.default = _default; //# sourceMappingURL=arrayForEach.js.map