I’m trying to pass this way point but I can’t get my code to pass. ‘gabriel’ and ‘bee’ return true but ‘gabriel’ and ‘gabriel’ return false.
function mutation(arr) {
one = arr.slice(0,1).toString().toLowerCase();
two = arr.slice(1,2).toString().toLowerCase();
z = 0
for (x = 0; x < two.length; x++){
if (one.indexOf(two[x]) > 0) {
z++;
}
}
if (z === two.length){
return true;
} else {
return false;
}
}
mutation(['gabriel','bee'])