2019-12-01から1ヶ月間の記事一覧
変数をキーにしたオブジェクトを作りたい const Button = { left: 1, } const buttonActionMap = { Button.left: this.moveLeft, } これだとエラー。 キーを[]で囲うとエラーが消える const Button = { left: 1, } const buttonActionMap = { [Button.left]:…
変数をキーにしたオブジェクトを作りたい const Button = { left: 1, } const buttonActionMap = { Button.left: this.moveLeft, } これだとエラー。 キーを[]で囲うとエラーが消える const Button = { left: 1, } const buttonActionMap = { [Button.left]:…