Update style.md

This commit is contained in:
tommyZZM
2015-12-02 16:38:49 +08:00
parent 372eb0f67f
commit 421b8ab321
+6 -2
View File
@@ -260,11 +260,15 @@ const nodes = Array.from(foo);
});
// good
[1, 2, 3].map((x) => {
return x * x;
});
// best
[1, 2, 3].map(x => x * x);
// with more argument and code
// best
[1, 2, 3].map((x,i) => {
console.log(x);
return x * i;
});
```