JavaScript: Set.prototype.has

By Xah Lee. Date: . Last updated: .

New in JS2015.

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

// check existence

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

JS Obj Reference

Set

prototype