-
Notifications
You must be signed in to change notification settings - Fork 1
from
Subhajit Sahu edited this page Dec 2, 2022
·
19 revisions
Convert an iterable to set.
function from(x, fm)
// x: an iterable
// fm: map function (v, i, x)
const set = require('extra-set');
var vs = [1, 2, 3, 4];
set.from(vs);
// → Set(4) { 1, 2, 3, 4 }
set.from(vs, v => v % 2);
// → Set(2) { 1, 0 }