Skip to content

Commit 5b8b56e

Browse files
author
Tomek Wiszniewski
committed
Upgrade a note about parens to another rule
1 parent 5634c4c commit 5b8b56e

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

README.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -631,6 +631,18 @@
631631
});
632632
```
633633
634+
- [8.3](#8.3) <a name='8.3'></a> If your function only takes a single argument, feel free to omit the parentheses.
635+
636+
> Why? Less visual clutter.
637+
638+
```js
639+
// good
640+
[1, 2, 3].map(x => x * x);
641+
642+
// good
643+
[1, 2, 3].reduce((y, x) => x + y);
644+
```
645+
634646
**[⬆ back to top](#table-of-contents)**
635647
636648

0 commit comments

Comments
 (0)