How to check if a set contains a value in TypeScript

1 Answer

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

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

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



/*
run:
 
true 
false 
  
*/
  
  

 



answered Jun 2, 2022 by avibootz
...