Reputation: 2306
Am getting used to CoffeeScript, and have what is probably a stupid question: how do I call a function on an anoymous function? So here's the javascript example
baz = function() {
this.do_something_to_this_function
}
foo = {
bar: function() {
// do something to some data
}.baz()
}
How would I do this same thing in CoffeeScript?
I know I could do this:
barfunc = => blah blah blah
foo = {
bar: barfunc.baz()
}
It seems there must be a prettier way?
Upvotes: 0
Views: 78