1
0
mirror of https://github.com/ruanyf/es6tutorial.git synced 2025-05-25 11:12:21 +00:00

Merge pull request #101 from tommyZZM/patch-1

箭头函数只有一个参数时,可以更加简洁
This commit is contained in:
Ruan YiFeng 2015-12-02 18:22:42 +08:00
commit d6ba6105f2

View File

@ -263,6 +263,9 @@ const nodes = Array.from(foo);
[1, 2, 3].map((x) => { [1, 2, 3].map((x) => {
return x * x; return x * x;
}); });
// best
[1, 2, 3].map(x => x * x);
``` ```
箭头函数取代`Function.prototype.bind`不应再用self/\_this/that绑定 this。 箭头函数取代`Function.prototype.bind`不应再用self/\_this/that绑定 this。