Skip to content

Instantly share code, notes, and snippets.

@dangalipo
Created September 14, 2012 06:52
Show Gist options
  • Save dangalipo/3720303 to your computer and use it in GitHub Desktop.
Save dangalipo/3720303 to your computer and use it in GitHub Desktop.
class Foo
constructor:(@a) ->
bar:
funcA: ->
console.log @a
objA = new Foo('hello')
objB = new Foo('hello')
objA.bar.funcA = ->
console.log 'word'
objA.bar.funcA() # 'word'
objB.bar.funcA() # 'word'.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment