array-for-each-x

Executes a provided function once for each array element.

MIT 33 个版本
安装
npm install array-for-each-x
yarn add array-for-each-x
pnpm add array-for-each-x
bun add array-for-each-x
README

Travis status Dependency status devDependency status npm version jsDelivr hits bettercodehub score Coverage Status

array-for-each-x

Executes a provided function once for each array element.

module.exports

This method executes a provided function once for each array element.

Kind: Exported member
Throws:

  • TypeError If array is null or undefined.
  • TypeError If callBack is not a function.
Param Type Description
array array The array to iterate over.
callBack function Function to execute for each element.
[thisArg] * Value to use as this when executing callback.

Example

import forEach from 'array-for-each-x';

const items = ['item1', 'item2', 'item3'];
const copy = [];

forEach(items, function(item) {
  copy.push(item);
});

console.log(copy); // ['item1', 'item2', 'item3']
版本列表
3.1.2 2019-08-28
3.1.1 2019-08-20
3.1.0 2019-08-14
3.0.22 2019-08-05
3.0.21 2019-08-05
3.0.20 2019-07-31
3.0.19 2019-07-27
3.0.18 2019-07-27
3.0.17 2019-07-26
3.0.16 2019-07-25
3.0.15 2019-07-24
3.0.14 2019-07-24
3.0.13 2019-07-22
3.0.12 2019-07-21
3.0.11 2019-07-19
3.0.10 2019-07-18
3.0.9 2019-07-17
3.0.8 2019-07-17
3.0.7 2019-07-17
3.0.6 2019-07-17
3.0.4 2019-07-16
3.0.3 2019-07-16
3.0.2 2019-07-16
3.0.1 2019-07-15
3.0.0 2019-07-15
2.3.0 2017-11-10
2.2.0 2017-09-08
2.1.0 2017-09-07
2.0.0 2017-09-06
1.2.0 2017-08-15
1.1.0 2017-08-11
1.0.2 2017-08-10
1.0.0 2017-08-09