Skip to content

Commit b54ce43

Browse files
author
Tomek Wiszniewski
committed
Clarify 8.4
1 parent 32ec9dd commit b54ce43

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

README.md

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -743,7 +743,7 @@ Other Style Guides
743743
```
744744
745745
746-
- [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.
746+
- [8.4](#8.4) <a name='8.4'></a> If your function takes a single argument and doesn’t use braces, omit the parentheses.
747747
748748
> Why? Less visual clutter.
749749
@@ -756,6 +756,12 @@ Other Style Guides
756756
// good
757757
[1, 2, 3].map(x => x * x);
758758

759+
// good
760+
[1, 2, 3].map(number => (
761+
`A long string with the ${number}. It’s so long that we’ve broken it ` +
762+
'over multiple lines!'
763+
));
764+
759765
// bad
760766
[1, 2, 3].reduce(x => {
761767
const y = x + 1;

0 commit comments

Comments
 (0)