Tell us what’s happening:
below code not working …mutation([“hello”, “hey”]); return true;
Your code so far
function mutation(arr) {
var first= arr[1].toLowerCase();
var last=arr[0].toLowerCase();
for(var i= 0;i<first.length;i++){
if(last.indexOf(first[i])===-1)
return false;
return true;
}
}
mutation(["hello", "hey"]);
Your browser information:
Your Browser User Agent is: Mozilla/5.0 (Windows NT 6.1; rv:58.0) Gecko/20100101 Firefox/58.0
.
Link to the challenge:
https://www.freecodecamp.org/challenges/mutations