JavaScript: Set.prototype.has

By Xah Lee. Date: . Last updated: .

New in JS2015.

setObj.has(value)
Return true if value is in set. Else, false.
const xx = new Set([3, 4, 5]);

// check existence

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

JS Obj Reference

Set

prototype