"Return true if the string in the first element of the array contains all of the letters of the string in the second element of the array." For some reason I can pass every other checkpoint except (["hello", "hey"]). any tips?
function mutation(arr) {
var firstIndex = arr[0].toLowerCase();
var secondIndex = arr[1].toLowerCase();
for(var i = 0; i < arr.length; i++) {
if(firstIndex.indexOf(secondIndex.charAt(i)) !== -1) {
return true;
}
else {
return false;
}
}
return arr;
}
mutation(["hello", "hey"]);