How to create a set from an array of characters in Node.js

1 Answer

0 votes
const arr = ["n", "o", "d", "e", ".", "j", "s"]
 
const st = new Set(arr);
 
console.log(st);
  
  
  
  
/*
run:
  
Set(7) { 'n', 'o', 'd', 'e', '.', 'j', 's' }
  
*/

 



answered Mar 2, 2024 by avibootz

Related questions

...