How does this object method definition work without the “function” keyword?

后端 未结 2 1102
遥遥无期
遥遥无期 2020-11-22 04:17

I discovered this by accidentally leaving off the function keyword. Ordinarily the foobar method in the module below would be declared as fo

2条回答
  •  暖寄归人
    2020-11-22 04:24

    ES6 allows "concise methods" which, as you've discovered, aren't cross-browser compatible yet.

提交回复
热议问题