JavaScript Brackets

01.22.2015

When you have a one line statement in a conditional or loop, the brackets are optional.

Anything more than one line without brackets will produce unexpected behavior.

To avoid confusion, it’s best practice to always use brackets.

Source

Code School JavaScript Best Practices