Tell us what’s happening: So it seems like this isn’t working because arr[0] does not contain all of arr[1]?How do I say “if arr[0] contains any amount of arr[1] in any order: return true”?
How would you edit my code in the least amount possible to get it to work? Am I somewhat on the right track with the approach I’ve taken?
Your code so far
function mutation(arr) {
var x = arr[0].toLowerCase('');
var y = arr[1].toLowerCase('');
var xx = x.split('');
var yy = y.split('');
if (xx.includes(yy)) {
return true;
}
return false;
}
mutation(["Mary", "Aarmy"]);
Link to the challenge:
https://www.freecodecamp.org/challenges/mutations