Tell us what’s happening:
Please advise what needs to be fixed for this challenge to pass. I’m unclear on why 5 of the 9 are not passing.
Your code so far
function mutation(arr) {
var i = 0;
var string = arr[0].toLowerCase(); // convert the word to lowercase
var wordChars = arr[1].toLowerCase().split(); //convert each letter of the word to lowercase
while (i < wordChars.length) {
if (string.indexOf(wordChars[i]) > -1) {
i++;
return true;
} else {
return false;
}
}
}
mutation(["hello", "hey"]);
Link to the challenge: