Hey guys, I’m not getting any false values so it’s not working. What am I doing wrong with the loop?
**Your code so far**
function mutation(arr) {
var newStr0 = arr[0].toLowerCase();
var newStr1 = arr[1].toLowerCase()
var newArr0 = newStr0.split("");
var newArr1 = newStr1.split("");
for (let j = 0; j < newArr1.length; j++) { // loop through all the letter in 1 index of arr
if (newArr0.indexOf(newArr1[j]) >= 0); // if all letters in separated string of arr[0] has a index of equal to order greater than 0 then return true
} return true;
} false;
console.log(mutation(["hello", "neo"]));
// initialize newArr1 as arr[1] with separated string
// initalize newArr0 as arr[0] with separated string
// loop through newArr0 to see at what index of newArr0 is newArr1
// if === -1
// return false
**Your browser information:**
User Agent is: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/88.0.4324.146 Safari/537.36
.
Challenge: Mutations
Link to the challenge: