Created
March 21, 2011 04:58
-
-
Save jaekwon/879058 to your computer and use it in GitHub Desktop.
declaring inner scope variables in coffeescript
This file contains hidden or 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
foo = -> | |
dog = "a dog" | |
transmorg = -> | |
`var dog = "a cat"` | |
console.log "in transmorg: dog == #{dog}" | |
transmorg() | |
console.log "outside, dog == #{dog}" | |
foo() | |
>in transmorg: dog == a cat | |
>outside, dog == a dog |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment