JS: Set.prototype.has
New in ES2015.
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
Reference
ECMAScript 2015 §Keyed Collection#sec-set.prototype.has
Set Topic
If you have a question, put $5 at patreon and message me.