Implement the Mutations Algorithm - Implement the Mutations Algorithm

Tell us what’s happening:

I know where I’m going wrong, but I can’t figure out why this approach isn’t working.

Your code so far

function mutation(arr){
  let arrStart = arr[0].toLowerCase()
  let arrSecond = arr[1].toLowerCase() 
  for(let array of arrSecond){
    if(!arrStart.includes(array)){
      return false
    }
    else {
      return true
    }
  }
}

Your browser information:

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

Challenge Information:

Implement the Mutations Algorithm - Implement the Mutations Algorithm

Hi there!

Your loop returns after checking only one character. Try to get into the habit of using console.log() to debug your code so you can see what it’s doing.

Happy coding!

I see now. Thank you for explaining.

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