Tell us what’s happening:
Hello ! I can’t figure out why my code is returning true instead of false. Somebody can explain me what’s wrong with my ‘solution’ please.
**Your code so far**
function mutation(arr) {
let test1 = arr[1].toLowerCase;
let test2 = arr[0].toLowerCase;
for (let i = 0; i < test1.length; i++) {
if(test2.indexOf(test1[i]) < 0) return false;
}
return true;
}
console.log(mutation(["hello", "hey"]));
**Your browser information:**
User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/90.0.4430.93 Safari/537.36
.
Challenge: Mutations
Link to the challenge: