When it is mandatory to use dot-comma Javascript [duplicate]

2

I wanted to know when it is mandatory to use a semicolon in Javascript.

    
asked by anonymous 10.02.2014 / 22:12

1 answer

5

The use of the semicolon is still mandatory when using the for loop and when the line you start with any of these you should end the command with a semicolon: ([+-/* [ font ]

In most cases, it should also be used when using more than one statement on the same line. There are the exception of several statements within an expression, in which case commas can play the role of a semicolon:

if (condição) faça_isso(), e_também_isso()
    
10.02.2014 / 22:17