Skip to content
Subhajit Sahu edited this page Jun 13, 2020 · 14 revisions

Adds value to set. [:running:] [:vhs:] [:package:] [:moon:] [:ledger:]

Alternatives: [add], [add$].
Similar: [add], [remove].

set.add(x, v);
// x: a set
// v: value
const set = require('extra-set');

var x = new Set([2, 4, 6 ,8]);
set.add(x, 40);
// Set(5) { 2, 4, 6, 8, 40 }

set.add(x, 80);
// Set(5) { 2, 4, 6, 8, 80 }

references

Clone this wiki locally