Mutations challenge. My code is returning the wrong boolean on 3rd, 5th and last argument

Mutations challenge. My code is returning the wrong boolean on 3rd, 5th and last argument
0

#1

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;
  }
}

Mutations Challenge


#2

You have a couple of issues, but the main problem is that you are testing the wrong elements in your for loop. Instead of checking to see if againstArr elements are in testerArr, you should have it reversed. An easy fix for this would be to change the assignments in the first two lines of the function.
The other issue is, is that the variable io will always have the result of the last indexOf check. You want to check all the letters and not just the last character.