如何在CoffeeScript中创建命名函数表达式? [英] How do I create a named function expressions in CoffeeScript?
本文介绍了如何在CoffeeScript中创建命名函数表达式?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
如何在CoffeeScript中创建命名的函数表达式,如下面的示例?
var a = function b(param1){}
或
返回函数链接 Coffeescript不支持后者(命名函数),但前者可以通过 a =(param1) - >
console.log param1
How do I create a named function expressions in CoffeeScript like the examples below?
var a = function b (param1) {}
or
return function link (scope) {}
解决方案 Coffeescript doesn't support the latter (named functions), but the former can be achieved with
a = (param1) ->
console.log param1
这篇关于如何在CoffeeScript中创建命名函数表达式?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文