-
Notifications
You must be signed in to change notification settings - Fork 1
forEach
Subhajit Sahu edited this page May 10, 2020
·
18 revisions
Calls a function for each value. 🏃 📼 📦 🌔
iterable.forEach(x, fn, [ths]);
// x: an iterable
// fn: called function (v, i, x)
// ths: this argument
const iterable = require('extra-iterable');
var x = [1, 2, -3, -4];
iterable.forEach(x, v => console.log(v));
// 1
// 2
// -3
// -4
- Array.prototype.forEach: MDN web docs
- array_walk: PHP