Tell us what’s happening:
All tests are passing except the first
The array gets destructured into two variables, then each letter of the second word is checked against the first and if included returns true, otherwise returns false. Except for “hey” into “hello”..
Your code so far
function mutation (array) {
let [ firstWord, secondWord ] = array;
for (let letter of secondWord) {
if (firstWord.toLowerCase().includes(letter.toLowerCase())) {
return true;
} else {
return false;
}
}
}
Your browser information:
User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/140.0.0.0 Safari/537.36
Challenge Information:
Implement the Mutations Algorithm - Implement the Mutations Algorithm