How Do I Create A Named Function Expressions In Coffeescript?
How do I create a named function expressions in CoffeeScript like the examples below? var a = function b (param1) {} or return function link (scope) {}
Solution 1:
I may be a bit late to the party, but I just realised that you actually create named functions when using the class
keyword.
Example:
classmyFunction
# The functions actual code is wrapped in the constructor method
constructor: ->
console.log 'something'
console.log myFunction # -> function AppComponent() { ... }
myFunction() # -> 'something'
Post a Comment for "How Do I Create A Named Function Expressions In Coffeescript?"