How to check if a set contains an array in Node.js

1 Answer

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

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

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

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

  
  
  
  
/*
run:
  
true
nodejs,python,c c++
  
*/

 



answered May 13, 2022 by avibootz
...