How to check if a set contains a value in JavaScript

1 Answer

0 votes
const st = new Set(['javascript', 'typescript', 'node.js', 'c++']);

console.log(st.has('javascript')); 

console.log(st.has('php'));



/*
run:
 
true
false
  
*/
  

 



answered Jun 2, 2022 by avibootz
...