Skip to content

Instantly share code, notes, and snippets.

@alexandru-calinoiu
Created February 19, 2012 16:23
Show Gist options
  • Save alexandru-calinoiu/1864508 to your computer and use it in GitHub Desktop.
Save alexandru-calinoiu/1864508 to your computer and use it in GitHub Desktop.
a closure example in CoffeScript
view = (message) ->
console.log(message)
variable = "first"
parentFunction = ->
variable = "second"
childFunction = ->
view variable
childFunction
child = parentFunction()
child()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment