上QQ阅读APP看书,第一时间看更新
Arrow functions - the modern way
Even if arrow functions pretty much work as the other functions, there are some important differences with usual functions. These functions can implicitly return a value, the value of this is not bound, and there is no arguments object. Let's go over these three points.
There are some extra differences: arrow functions cannot be used as constructors, they do not have a prototype property, and they cannot be used as generators because they don't allow the yield keyword. For more details on these points, see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Functions/Arrow_functions#No_binding_of_this.