Created
July 20, 2011 11:58
-
-
Save rakeshpai/1094831 to your computer and use it in GitHub Desktop.
Variable shadowing in CoffeeScript, based on assignment scope
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
func = -> x = "some other string" | |
x = "some string" | |
func() | |
alert(x) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
The compiled code. Note how x is redeclared inside the scope of the function.