【发布时间】:2012-06-26 01:13:41
【问题描述】:
假设我有一个这样的 Coffeescript 类:
class Foo
aVar = 'foo'
someFunction = ->
anotherVar = 'bar'
有没有办法将anotherVar 设置为类变量而不必将其声明为null,如下所示:
class Foo
aVar = 'foo'
anotherVar = null
someFunction = ->
anotherVar = 'bar'
【问题讨论】:
标签: class coffeescript