Many times I've seen a semicolon used after a function declaration, or after the anonymous "return" function of a Module Pattern script. When is it appropriate to use a semicolon after curly braces?
相关问题
- Is there a limit to how many levels you can nest i
- How to toggle on Order in ReactJS
- void before promise syntax
- Keeping track of variable instances
- Can php detect if javascript is on or not?
You also should use a semicolon after a curly bracket after returning a function within a function in Javascript.
Don't use a semicolon:
...if it's just your every-day function declaration:
Use a semicolon:
...if it's an assignment:
...or a self invoking function: