Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // It does't add a semicolon in the case of a leading parenthesis, so....
- // You will end up with a type error,
- // since Javascript parser assumes that "5" is a function and "(function(){ console.log(x) })"
- // is its parameter...
- var x = 5 // JS parser does not add ; here
- (function(){ console.log(x) })()
- // the code above will get an error: Uncaught TypeError: 5 is not a function(…)
- // because the interpeter read it like this
- var x = 5(function(){ console.log(x) })()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement