Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

set.contains in javascript

const set = new Set();

set.add(1);
set.add(2);
set.add(3);

console.log(set.has(2));  //true
console.log(set.has(4)); //false
 
PREVIOUS NEXT
Tagged: #javascript
ADD COMMENT
Topic
Name
4+1 =