Skip to content

Instantly share code, notes, and snippets.

@jaekwon
Created March 21, 2011 04:58
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jaekwon/879058 to your computer and use it in GitHub Desktop.
Save jaekwon/879058 to your computer and use it in GitHub Desktop.
declaring inner scope variables in coffeescript
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