Tell us what’s happening:
The only thing that is not passing is the very first one: mutation([“hello”, “hey”]) should return false.
Your code so far
function mutation(arr) {
let arr1 = arr[0].toLowerCase();
let arr2 = arr[1].toLowerCase();
for(let i = 0; i < arr2.length; i++) {
if(arr1.indexOf(arr2[i]) < 0) {
return false;
}
return true;
}
}
mutation(["hello", "hey"]);
Your browser information:
User Agent is: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_4) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/67.0.3396.99 Safari/537.36
.
Link to the challenge:
https://learn.freecodecamp.org/javascript-algorithms-and-data-structures/basic-algorithm-scripting/mutations