JavaScript: Set.prototype.delete

By Xah Lee. Date: . Last updated: .

New in JS2015.

setObj.delete(value)
Delete value in the set setObj. Return true if found, else false.
const xx = new Set([4, 5, 6]);

// delete a value. return true if found
console.log(xx.delete(5) === true);

console.log(xx.delete(99) === false);
BUY
ΣJS
JavaScript in Depth

JS Obj Reference

Set

prototype