How to count the unique characters in a string with Node.js

1 Answer

0 votes
const str = 'javascript typescript node.js python';

const count = new Set(str).size;

console.log(count); 
  
  
  
  
  
/*
run:
  
17
  
*/

 



answered May 3, 2022 by avibootz
...