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

Update style.md

This commit is contained in:
tommyZZM 2015-12-02 16:38:49 +08:00
parent 372eb0f67f
commit 421b8ab321

View File

@ -260,11 +260,15 @@ const nodes = Array.from(foo);
}); });
// good // good
[1, 2, 3].map((x) => {
return x * x;
});
// best
[1, 2, 3].map(x => x * x); [1, 2, 3].map(x => x * x);
// with more argument and code // best
[1, 2, 3].map((x,i) => { [1, 2, 3].map((x,i) => {
console.log(x);
return x * i; return x * i;
}); });
``` ```