-
Notifications
You must be signed in to change notification settings - Fork 1
take$
Subhajit Sahu edited this page Jun 13, 2020
·
14 revisions
Keeps first n values only. 🏃 📼 📦 🌔 📒
set.take$(x, [n]);
// x: a set (updated)
// n: number of values (1)
// --> x
const set = require('extra-set');
var x = new Set([1, 2, 3, 4]);
set.take$(x, 2);
// Set(2) { 1, 2 }
x;
// Set(2) { 1, 2 }
var x = new Set([1, 2, 3, 4]);
set.take$(x, 3);
// Set(3) { 1, 2, 3 }