Tell us what’s happening:
Plz help me all the test pass but this one didn’t because it has a repeating character. I am trying to solve it wilthout javaScripts own fuctions.
**Your code so far**
function mutation(arr) {
let second = arr[1].toLowerCase()
let first = arr[0].toLowerCase()
let newArr = [];
for(let i = 0; i < second.length; i++) {
for(let j = 0; j < first.length; j++) {
if(second[i] === first[j]) {
newArr.push(true)
} else if(second[i] === first[j]) {
newArr.push(false)
} else {
newArr.push(false)
}
}
}
let trueArray = [];
for(let i = 0; i < newArr.length; i++) {
if(newArr[i] === true){
trueArray.push(newArr[i])
}
}
if (second.length === trueArray.length) {
return true;
} else {
return false
}
}
console.log(mutation(["floor", "for"]));
**Your browser information:**
User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/90.0.4430.85 Safari/537.36
.
Challenge: Mutations
Link to the challenge: