Implement the Mutations Algorithm - Implement the Mutations Algorithm

Tell us what’s happening:

i don’t know what to do

function mutation(arr){
const firstElement = arr[0];
const secondElement = arr[1];

for (let char of firstElement){
if (firstElement == secondElement){
return true;
} else {
return false;
}
}
}

Your code so far

function mutation(arr){
const firstElement = arr[0];
const secondElement = arr[1];

for (let char of firstElement){
  if (firstElement == secondElement){
    return true;
  } else {
    return false;
  }
}
}

console.log(mutation(["mary", "army"]))

Your browser information:

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

Challenge Information:

Implement the Mutations Algorithm - Implement the Mutations Algorithm

Please Tell us what’s happening in your own words.

Learning to describe problems is hard, but it is an important part of learning how to code.

Also, the more you say, the more we can help!

1 Like