Basic Algorithm Scripting: Mutations , good approach?

Tell us what’s happening:
hello everyone i dont know whats wrong with my script

or is my approach wrong ?

Your code so far

  for (let i = 0 ; i < arr[1].length; i++){
   for (let p = 0 ; p < arr[0].length; p++){
     if (arr[1][i] == arr[0][p]) { if (i == arr[1].length - 1){
          return true;
        } 
   } else {return false }

  }
  
}
}
mutation(["hello", "he"]);

Your browser information:

User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:66.0) Gecko/20100101 Firefox/66.0.

Link to the challenge:
https://learn.freecodecamp.org/javascript-algorithms-and-data-structures/basic-algorithm-scripting/mutations

It’s an interesting approach and definitely could be made to work

There are some functions that can help you write this function more straightforwardly:

String.includes can tell you if a string is inside another string. Obviously you’re looking to check individual characters, rather than the whole string, but this can get rid of one of your loops by using this function

Don’t forget that capitalisation needs to not matter