Share and @ for global variable in coffee script difference?


I am using coffeescript. When declaring a global variable you have to used @ or share. What is the difference? You still have to put share or @ every global variable if you want to access it.


What is this “share”?
share a outputs share(a) in


Looks like there’s an explanation here, though I’ve not used this technique before.


@JamesLefrere yes. that’s my point. you have to put share keyword every global variable. In the link you post this is the example given
   share.greet = (name) ->
     console.log "Hello, #{ name }!"
   share.greet 'World'

Why bother used share. When you can just used @ sign? like this one
   @greet = (name) ->
     console.log "Hello, #{ name }!"
   @greet 'World'


@manuel share keyword for global variable in coffeescript