Created
April 16, 2018 18:39
-
-
Save wholypantalones/b150acd9eb63a2eb87c872da6121542a to your computer and use it in GitHub Desktop.
reduce totals function
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
getTotals(items, prop) { | |
return items.reduce( function(a, b) { | |
return a + b[prop]; | |
}, 0); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment