Mutations > almost solved

Tell us what’s happening:

So far I can reach. but [“hello”, “heo”], should return true because all of the letters in “heo” are present in “Alien”. How can i solve this part. i don’t wanna get code actually, i want to get some descriptive clue. Thanks in advance.
Your code so far

function mutation(arr) {
  if (arr.indexOf(arr[1]) > -1) {
    return true;
  } else if (arr.indexOf(arr[1]) === -1){
    return false;

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

Your browser information:

Your Browser User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/66.0.3359.139 Safari/537.36.

Link to the challenge:

You’re going to need a more complex solution than that. Right now, it is always returning true. Basically the first if always is true. You are checking it the second string is in the array. Yes, "heo" is in '[“hello”, “heo”]. This will always be true by definition and is not what you are supposed to be checking. You need to break it down and check the letters. You need to see if all of the letter in the second string are in the second string. One solution is to loop through the second string and check if they are in the first string. If one isn’t, then the test fails.

1 Like

I am going through a wrong way i realise :frowning: