javascript icon indicating copy to clipboard operation
javascript copied to clipboard

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

Open praveeno opened this issue 6 years ago • 2 comments

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 avatar May 14 '18 14:05 praveeno

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

What would you suggest?

ljharb avatar May 14 '18 15:05 ljharb

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

abhinavsharma629 avatar Aug 15 '19 06:08 abhinavsharma629