ConstElement type produced by the source iterable.
Callback invoked with the current value and index for its side effects.
void after running the action against every item from the source.
const log: Array<[number, number]> = [];
_forEach([10, 20], (value, index) => {
log.push([value, index]);
});
console.log(log); // [[10, 0], [20, 1]]
or using the curried version:
const log: string[] = [];
pipeInto(
["a", "b"],
forEach((value, index) => {
log.push(`${index}:${value}`);
})
);
console.log(log); // ["0:a", "1:b"]
Executes the provided action for each element in the source iterable.
Curried version of _forEach.