I wanted to know when it is mandatory to use a semicolon in Javascript.
I wanted to know when it is mandatory to use a semicolon in Javascript.
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()