}). There are some instances where semicolons are not necessary, like when your code is the first line of a conditional statement, loop, or function definition.
continuekeywords as semicolons.
++postfix operators as semicolons. Always keep your operator right next to your variable like this:
If you have a statement that starts with a
( or a
[, you have to watch out for continuation from the previous statement. Use an explicit terminating semicolon at the end of the previous statement if you are unsure of its continuation. Here are all the characters that when used to start a statement, could be interpreted as continuation of the previous statement:
You can also proactively defend against continuation by starting your statement with a semicolon (also called a defensive semicolon).