Skip to content

forEach

Subhajit Sahu edited this page Nov 20, 2022 · 14 revisions

Call a function for each value.


function forEach(x, fp)
// x:  an array
// fp: process function (v, i, x)
const array = require('extra-array');

var x = [1, 2, -3, -4];
array.forEach(x, v => console.log(v));
// → 1
// → 2
// → -3
// → -4


References

Clone this wiki locally