When should I use Arrow functions in ECMAScript 6?

后端 未结 9 1619
滥情空心
滥情空心 2020-11-21 05:53

The question is directed at people who have thought about code style in the context of the upcoming ECMAScript 6 (Harmony) and who have already worked with the language.

9条回答
  •  不知归路
    2020-11-21 06:15

    I prefer to use arrow functions at all times where access to local this is not needed, because arrow function do not bind their own this, arguments, super, or new.target.

提交回复
热议问题