Share your code. Components are building blocks, you are the architect.

utils/for-each
v1.1.0
1.1.0
1.0.0
MIT
PUBLIC
3
Build: fail
BuildFail
Build Status: fail
Iterate over an input `list`, calling a provided function `fn` for each

Please configure Bit as a scoped registry to install components with NPM.Learn more

npm config set '@bit:registry' https://node.bitsrc.io
Use utils/for-each in your project
npm i @bit/bit.ramda.utils.for-each
Copied

forEach (fn:Function, list:Array) : Array

Iterate over an input list, calling a provided function fn for each element in the list.

fn receives one argument: (value).

Note: R.forEach does not skip deleted or unassigned indices (sparse arrays), unlike the native Array.prototype.forEach method. For more details on this behavior, see: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/forEach#Description

Also note that, unlike Array.prototype.forEach, Ramda’s forEach returns the original array. In some libraries this function is named each.

Dispatches to the forEach method of the second argument, if present.

Example

var printXPlusFive = x => console.log(x + 5);
     R.forEach(printXPlusFive, [1, 2, 3]); //=> [1, 2, 3]
     // logs 6
     // logs 7
     // logs 8

Arguments

fn: Function

The function to invoke. Receives one argument, `value`.

list: Array

The list to iterate over.

Returns

Array

The original list.