@josecarlosrz/array-helper
Helper to get async operations on methods like forEach
, map
, reduce
, and some utilities like shuffle
and unique
.
It doesn't modify the original Array prototype.
Installation
npm install @josecarlosrz/array-helper
Methods
The same parameters found on the docs, adding the array to work with at the beginning.
forEach(arr, closure [, thisArg])
map(arr, closure [, thisArg])
filter(arr, closure [, thisArg])
some(arr, closure [, thisArg])
reduce(arr, closure [, thisArg])
reduceRight(arr, closure [, thisArg])
filter(arr, closure [, thisArg])
some(arr, closure [, thisArg])
every(arr, closure [, thisArg])
find(arr, closure [, thisArg])
findIndex(arr, closure [, thisArg])
areEqual(a, b)
unique(arr)
shuffle(arr)
Usage
const arrayHelper = require('@josecarlosrz/array-helper');
const array = [1, 2, 3];
await arrayHelper.forEach(array, async (element) => {
});
Follow me on Instagram!
@josecarlosrz on Instagram