Created
July 23, 2011 12:02
-
-
Save vlasovskikh/1101352 to your computer and use it in GitHub Desktop.
Local vars in CoffeeScript are nonlocal sometimes
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
f = -> | |
x = 2 | |
x = 1 | |
> console.debug "x = #{ x }" | |
x = 1 | |
> console.debug "f() = #{ f() }" | |
f() = 2 | |
> console.debug "x = #{ x }" | |
x = 1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
x = 1 | |
f = -> | |
x = 2 | |
> console.debug "x = #{ x }" | |
x = 1 | |
> console.debug "f() = #{ f() }" | |
f() = 2 | |
> console.debug "x = #{ x }" | |
x = 2 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
@autotelicum Thanks for these very relevant links! :)