Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
sをインスタンス化しようとするとMyClass()、次のエラーが発生します。
MyClass()
s = new MyClass(); > TypeError: 'undefined' is not a function (evaluating '_class.apply(this, arguments)')
クラスです
class MyClass constructor: (@value = 'defaultValue') ….
このエラーの原因は何ですか?
コンストラクターは関数である必要があるため、次を指定する必要があります->。
->
class MyClass constructor: (@value = 'defaultValue') ->
デモ