Created
May 21, 2017 20:05
-
-
Save himynameisdave/71252fcbfd3429432ba003d0042f6eeb to your computer and use it in GitHub Desktop.
Reduce your fears about .reduce() - Array.find with reduce 01
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const fruits = [ | |
{ name: ‘apples’, quantity: 2 }, | |
{ name: ‘bananas’, quantity: 0 }, | |
{ name: ‘cherries’, quantity: 5 } | |
]; | |
const thisShitIsBananas = fruits.reduce((accumulator, fruit) => { | |
return accumulator | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment