Best Practices

Never have lines break within a statement

Never start a newline with an opening curly parenthesis

Never start a newline with an opening square parenthesis

Do not use Anonymous Function Expressions

There is no way to refer to itself from inside the function (so recursion is not possible)
They are much harder to debug
They make your code harder to read

When semicolons are not optional

You must also include a semicolon in the following situations.
*) after the first and second statements inside a for loop

for ( var i = 0; i < 5; i++) 

© 2020 Better Solutions Limited. All Rights Reserved. © 2020 Better Solutions Limited TopPrevNext