mirror of
https://github.com/airbnb/javascript.git
synced 2026-01-14 00:28:25 -05:00
Upgrade a note about parens to another rule
This commit is contained in:
12
README.md
12
README.md
@@ -631,6 +631,18 @@
|
||||
});
|
||||
```
|
||||
|
||||
- [8.3](#8.3) <a name='8.3'></a> If your function only takes a single argument, feel free to omit the parentheses.
|
||||
|
||||
> Why? Less visual clutter.
|
||||
|
||||
```js
|
||||
// good
|
||||
[1, 2, 3].map(x => x * x);
|
||||
|
||||
// good
|
||||
[1, 2, 3].reduce((y, x) => x + y);
|
||||
```
|
||||
|
||||
**[⬆ back to top](#table-of-contents)**
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user