mirror of
https://github.com/airbnb/javascript.git
synced 2026-01-14 05:08:25 -05:00
[eslint-v2][arrays] fix example
This commit is contained in:
committed by
Jordan Harband
parent
b79e951280
commit
3983d380ed
17
README.md
17
README.md
@@ -374,7 +374,7 @@ Other Style Guides
|
||||
});
|
||||
|
||||
// bad
|
||||
inbox].filter((msg) => {
|
||||
inbox.filter((msg) => {
|
||||
const { subject, author } = msg;
|
||||
if (subject === 'Mockingbird') {
|
||||
return author === 'Harper Lee';
|
||||
@@ -384,15 +384,14 @@ Other Style Guides
|
||||
});
|
||||
|
||||
// good
|
||||
[1, 2, 3].filter((x) => {
|
||||
inbox].filter((msg) => {
|
||||
const { subject, author } = msg;
|
||||
if (subject === 'Mockingbird') {
|
||||
return author === 'Harper Lee';
|
||||
}
|
||||
inbox.filter((msg) => {
|
||||
const { subject, author } = msg;
|
||||
if (subject === 'Mockingbird') {
|
||||
return author === 'Harper Lee';
|
||||
}
|
||||
|
||||
return false;
|
||||
});
|
||||
return false;
|
||||
});
|
||||
```
|
||||
|
||||
**[⬆ back to top](#table-of-contents)**
|
||||
|
||||
Reference in New Issue
Block a user