Mutations help!

Mutations help!
0

#1

Hey all, my code passes just confused on one thing.

On my if statement, shouldn’t i need one of these { after my if condition??

I always thought if statements are as follows;

if (condition) {
statement ;
}

Here is my code

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

#2

If the body of the if-block (else, while, for too) consists of only one statement, the braces can be omitted.

// pefectly valid.
if (condition)
  statement;

You can even do

for (i=0;i<second.length;i++)
  if (first.indexOf(second[i])<0)
    return false;

but I don’t like it.