Created
December 30, 2018 00:52
-
-
Save zeptobook/8d49c0bec46b57ae9df7bba40c66a747 to your computer and use it in GitHub Desktop.
array.reduce()
This file contains 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
var nums = [10, 20, 30, 40, 50]; | |
var sum = nums.reduce(function(total, value){ | |
return total + value; | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment