Skip to content

forEach

Subhajit Sahu edited this page Dec 8, 2022 · 4 revisions

Call a function for each entry.

function forEach(x, fp)
// x:  an object
// fp: called function (v, k, x)
const object = require('extra-object');

var x = {a: 1, b: 2, c: -3, d: -4};
object.forEach(x, v => console.log(v));
// → 1
// → 2
// → -3
// → -4


References

Clone this wiki locally