Hopefully the question makes sense, the best way to explain would be to show you an example. I am creating a class in CoffeeScript and often use @ to represent "this" in JS, however, what is the best way to use it in the example below? At the moment I am storing @ in a local variable for that method, I was wondering if there was a better way
class app
constructor: ->
# store @ or "this" in a new local var
$this = @
# do some stuff
# Do some sort of jQuery stuff
$(document).jquerystuff(->
# do something that references this
$this.anotherMethod()
);