I’ve been wondering why some people put a semicolon at the end of their objects
Both of these above statements define the function ‘func’ and nothing more. Lets see what happens when you forget it.
This creates the function ‘func’ and the expression (true).
Here’s another scenario you might run into.
This immediately executes func and now x is undefined. Did you mean to do this?
This is a syntax error. Probably a good thing.
View this fiddle for an interactive version of this code.