Open dollarpo7 opened 7 years ago
function isIsogram(word){
var mySet = new Set(word); var nWord = [];
for(i=0; i < word.length; i++){ nWord.push(word[i]); } if (nWord.length !== mySet.size){ console.log(true) } else console.log(false) }
isIsogram("benin");
I GET THE ERROR BELOW, KINDLY HELP OUT for(i=0; i < word.length; i++){ ^ TypeError: Cannot read property 'length' of undefined
function isIsogram(word){
var mySet = new Set(word); var nWord = [];
for(i=0; i < word.length; i++){ nWord.push(word[i]); } if (nWord.length !== mySet.size){ console.log(true) } else console.log(false) }
isIsogram("benin");
I GET THE ERROR BELOW, KINDLY HELP OUT for(i=0; i < word.length; i++){ ^ TypeError: Cannot read property 'length' of undefined