Mutations can not pass 1st test

I have the same problem but here I don’t see any useful comment to know why? my code is This way:

function mutation(arr) {
  
  var firstString= arr[0].toLowerCase(); 
  var secondString= arr[1].toLowerCase();
  
  for (i=0; i<secondString.length; i++){
      if(firstString.indexOf(secondString[i]) === -1){
            return false;
          }else{
            return true;
          }
    }
} 

mutation(["hello", "hey"]);

Once your code executes one of the return statements, the function immediately exits and does not finish the for loop. For the test case of mutation([“hello”,“hey”]), in the first iteration of the for loop, the ‘h’ in ‘hey’ is found in firstString, so it returns an index not equal to -1. This causes your function to return true and then stop.

I just went through this issue and randell helped me understand it in another thread. I would link the thread, but it gives the answer away. Your are incredibly close. Like randell mentioned, take a look at your returns- it needs to be able to finish iterating over all letters in the string before returning true.