Skip to content

forEach

Subhajit Sahu edited this page Jun 13, 2020 · 16 revisions

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

set.forEach(x, fn, [ths]);
// x:   a set
// fn:  called function (v, v, x)
// ths: this argument
const set = require('extra-set');

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

references

Clone this wiki locally