My code does not return the right boolean on the 3rd, 5th and last arguments. I’m not sure why can anyone give me some insight?
function mutation(arr) {
var tester = arr[1].toLowerCase();
var against = arr[0].toLowerCase();
var testerArr = tester.split('');
var againstArr = against.split('');
for (var i = 0; i < tester.length; i++) {
var io = testerArr.indexOf(againstArr[i]);
}
if (io === -1) {
return false;
} else {
return true;
}
}