1
0
mirror of https://github.com/ruanyf/es6tutorial.git synced 2025-05-28 21:32:20 +00:00

Update style.md

usage of Arrow function
This commit is contained in:
tommyZZM 2015-12-02 16:25:29 +08:00
parent ce893ab576
commit 87d321e9ef

View File

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