Skip to content

Instantly share code, notes, and snippets.

@robertwalsh0
Created February 17, 2013 19:44
Show Gist options
  • Save robertwalsh0/4973061 to your computer and use it in GitHub Desktop.
Save robertwalsh0/4973061 to your computer and use it in GitHub Desktop.
Fat arrow?
firstname = "fatArrow other person"
bill =
firstname: 'skinnyArrow Bill'
lastname: 'williams'
skinnyArrow: -> console.log @firstname
fatArrow: => console.log @firstname
bill.skinnyArrow() #bound to the object in which it's called. hence it returns the firstname property of the "bill" object
bill.fatArrow() #bound to object CONTEXT because bill is in the window context, ie. window.bill
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment