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
JS in Depth
XAH  BUY NOW

JS in Depth

JS Obj Ref

DOM


JS Obj Ref

Set

prototype