Skip to content

Instantly share code, notes, and snippets.

@terraflubb
Created July 27, 2012 00:31
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 terraflubb/3185416 to your computer and use it in GitHub Desktop.
Save terraflubb/3185416 to your computer and use it in GitHub Desktop.
avoidwork's coffee quiz
# I'm not sure what you mean @avoidwork ...
#
# "how do you make a lambda pass this and call it global? do (global) -> :/
#
# If you mean "pass this" as in hang onto the context from which the
# function was declared, then I think you want to use the fat arrow =>
@banana = "tasty"
global = =>
console.log "Bananas are #{@banana}"
# Paste that into http://coffeescript.org/ to get the translation.
@avoidwork
Copy link

more along the lines of this...

do (global) ->
  true

@michaelficarra
Copy link

do (global = this) ->
  true

@avoidwork
Copy link

thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment