Skip to content

forEach

Subhajit Sahu edited this page Jun 18, 2020 · 4 revisions

Calls a function for each entry. 🏃 📼 📦 🌔 📒

object.forEach(x, fc);
// x:  an object
// fc: 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