juan field
asked on
how can i check if the text is an Isogram ?
THIS IS WHAT I HAVE SO FAR :
////////////////////////// ////////// ////////// ////////// ////////// /////
function isIsogram(text) {
// add each char to a set
// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Set
// note: a set drops dup values
// thus, to see if all the chars were unique,
// check length of text and the size of the set
var splittedText = text.split("");
text.forEach(function(elem ent){
if(element.repeat(1) === true || text.length === 0)
return true;
else
return false;
});
}
console.log(isIsogram("abc "))
//////////////////////////
function isIsogram(text) {
// add each char to a set
// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Set
// note: a set drops dup values
// thus, to see if all the chars were unique,
// check length of text and the size of the set
var splittedText = text.split("");
text.forEach(function(elem
if(element.repeat(1) === true || text.length === 0)
return true;
else
return false;
});
}
console.log(isIsogram("abc
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER