3 ms·
CoffeeScript doesn't always add var before assignments though, sometimes it does, sometimes it doesn't, depending on the variables in outer scopes. This has tw
by DougBTX 13y ago
CoffeeScript doesn't always add var before assignments though, sometimes it does, sometimes it doesn't, depending on the variables in outer scopes.
This has two assignments, but only one var in the compiled JS:
a = 1
-> a = 2
This has two vars:
-> a = 1
-> a = 2
- emn13 13y agoMuch worse is this gotcha: One variable: a = 1 -> a = 2 Two variables: -> a = 2 a = 1