Clarify 8.4

This commit is contained in:
Tomek Wiszniewski
2015-12-02 11:58:01 +01:00
parent 32ec9dd03a
commit b54ce438c8

View File

@@ -743,7 +743,7 @@ Other Style Guides
```
- [8.4](#8.4) <a name='8.4'></a> If your function takes a single argument and consists of a single expression, omit the parentheses.
- [8.4](#8.4) <a name='8.4'></a> If your function takes a single argument and doesnt use braces, omit the parentheses.
> Why? Less visual clutter.
@@ -756,6 +756,12 @@ Other Style Guides
// good
[1, 2, 3].map(x => x * x);
// good
[1, 2, 3].map(number => (
`A long string with the ${number}. Its so long that weve broken it ` +
'over multiple lines!'
));
// bad
[1, 2, 3].reduce(x => {
const y = x + 1;