How to determine if a string has all unique characters in JavaScript

1 Answer

0 votes
const str = 'javascript typescript node.js c++';
 
const result = new Set(str).size == str.length;
 
console.log(result ? "yes" : "no"); 
   
   
   
   
   
/*
run:
   
"no"
   
*/

 



answered May 7, 2022 by avibootz

Related questions

1 answer 228 views
1 answer 216 views
1 answer 250 views
1 answer 203 views
1 answer 210 views
1 answer 188 views
...