Mutations solution not working

Mutations solution not working
0

#1

Not sure why this code doesn’t work for this challenge?

function mutation(arr) {
  var str=[arr[0].toLowerCase(), arr[1].toLowerCase()];
for (var i = 0; i < str[1].length; i++) {
 } if (str[0].indexOf(str[1][i]) < 0) 
{
  return false;
 }
 return true;
 
}
mutation(["hello", "hey"]);

#2

your if statement outside the for loop.

 for (var i = 0; i &lt; str[1].length; i++) {
 }

#3

lol whoops, should have known it was something simple. Thanks!


#4

I cleaned up your code.
You forgot to close your code block with triple backticks.
See this post for details.