Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Shown Example Is Not Appropriate for arrays--callback-return #1806

Open
praveeno opened this issue May 14, 2018 · 2 comments · May be fixed by #2072
Open

Shown Example Is Not Appropriate for arrays--callback-return #1806

praveeno opened this issue May 14, 2018 · 2 comments · May be fixed by #2072

Comments

@praveeno
Copy link

praveeno commented May 14, 2018

4.6 in Readme
last example is shown as

 inbox.filter((msg) => {
   const { subject, author } = msg;
   if (subject === 'Mockingbird') {
     return author === 'Harper Lee';
   }
   return false;
 });

but its not a example of arrays--callback-return, its illustrate avoid of else, when using return statement.

@praveeno praveeno changed the title Shown Example Is Not Appropriate for arrays--callback-return May 14, 2018
@ljharb
Copy link
Collaborator

ljharb commented May 14, 2018

I agree that the difference between the last two examples is about no-else-return, not just array-callback-return.

What would you suggest?

@abhinavsharma629
Copy link

I just made a pull request regarding this issue sir.
Please have a look at it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment