1// Check if a string is an isogram
2function isIsogram(str){
3 return !str.match(/([a-z]).*\1/i);
4 //or: return new Set(str.toLowerCase()).size === str.length;
5}
6console.log(isIsogram("Dermatoglyphics"));//, true
7console.log(isIsogram("isogram")); //, true
8console.log(isIsogram("moOse")); //, false
9console.log(isIsogram("isIsogram")); //, false
10console.log(isIsogram("")); //, true