How to check if a set contains an array in TypeScript

1 Answer

0 votes
const arr = ['typescript', 'python', 'c'];

const st = new Set([arr, 'c++']);

console.log(st.has(arr)); 

console.log([...st].join(' '));

  
  
  
  
/*
run:
  
true 
"typescript,python,c c++" 
  
*/

 



answered May 13, 2022 by avibootz
...