Basic Algorithm Scripting - Mutations

Tell us what’s happening:
I feel like there is a problem with the tutorial here. I think my solution is perfect and I can’t find any fault whatsoever, still it doesn’t accept my code.

Your code so far

function mutation(arr) {
  const firstword = arr[0].toLowerCase;
  const secondword = arr[1].toLowerCase;
  for (let i=0;i<secondword.length;i++){
    if(firstword.indexOf(secondword[i])<0) return false;
  return true;

console.log(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/ Safari/537.36

Challenge: Basic Algorithm Scripting - Mutations

Link to the challenge:

Add the following after these two lines. You will find it is totally coincidence you passed any of the tests.

console.log(firstword, secondword)

I don’t understand. I get proper output now when I did console.log

What did I do wrong, can you please elaborate a bit?

The code you originally posted is different than your screenshot above. Can you post your latest code (no screenshots). What test are you failing now?

The two codes are same, except the addition of two console.logs, outputting firstword and secondword. I fail every test case that requires false as an output.

No they are not. In the first, you do not call the toLowerCase method. You just reference it.

If I change the code you originally posted to call toLowerCase, then the code passes all the tests. If you are still having trouble, please post your most current code.

Aah understood!! Thanks a lot, @RandellDawson.