Why does my code for the Mutations Algorithm pass all but one condition (the [“hello”, “hey”] should return false). https://www.freecodecamp.org/challenges/mutations
function mutation(arr) {
var arr1 = arr[0].toLowerCase();
var arr2 = arr[1].toLowerCase();
for(i=0; i < arr2.length; i++){
return arr1.indexOf(arr2[i]) !== -1;
}
}
mutation([“hello”, “hey”]);