Tell us what’s happening:
Describe your issue in detail here.
code runs correctly for all checkings but why it fails on this mutation ([“hello”, “hey”])
**Your code so far**
function mutation(arr) {
let str1=arr[0].toLowerCase();
let str2=arr[1].toLowerCase();
for (let i=0; i<str2.length; i++){
if(str1.indexOf(str2[i])<0){
return false;
}
else{
return true;
}
}
}
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/99.0.4844.82 Safari/537.36
Challenge: Mutations
Link to the challenge: