Why does this code return true for mutation challenge

For some reason this code returns true for [“hello”, “hey”] but it passes every other test and I don’t understand why

  **Your code so far**

function mutation(arr) {
let pre = arr[0].toLowerCase().split("");
//console.log(pre);
let post = arr[1].toLowerCase().split("");
//console.log(post);
if (pre.includes(...post)) {
  return true;
} else {
return false;
}
}

mutation(["hello", "hey"]);
  **Your browser information:**

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

Challenge: Mutations

Link to the challenge:

includes() does not work that way:

You can’t use multiple arguments like that.

thanks for the reply, I’ll try to figure something else out! Though I would still like to know why it passed every other test case except for the one I pointed out

Random chance. It just so happened that for many of the test cases the first character is the one that is the most important.

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.