Skip to content

Commit

Permalink
Clarify 8.4
Browse files Browse the repository at this point in the history
  • Loading branch information
Tomek Wiszniewski committed Jan 4, 2016
1 parent 32ec9dd commit b54ce43
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 doesn’t use braces, omit the parentheses.
> Why? Less visual clutter.
Expand All @@ -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}. It’s so long that we’ve broken it ` +
'over multiple lines!'
));

// bad
[1, 2, 3].reduce(x => {
const y = x + 1;
Expand Down

0 comments on commit b54ce43

Please sign in to comment.