2016-03-22から1日間の記事一覧
当たり前っちゃ当たり前なんだけど、以下のような状況でselfもといthisがundefinedだと怒られる。実体はprototypeと何も変わらない。 class Foo { constructor() { this._foo = "Hello"; } funcA() { let self = this; console.log(self._foo); } } function…
当たり前っちゃ当たり前なんだけど、以下のような状況でselfもといthisがundefinedだと怒られる。実体はprototypeと何も変わらない。 class Foo { constructor() { this._foo = "Hello"; } funcA() { let self = this; console.log(self._foo); } } function…