Last active
May 9, 2018 07:42
-
-
Save mgmgpyaesonewin/430c00210a20ab35eec6bd62b49b161e to your computer and use it in GitHub Desktop.
Finding the total number of item in a array
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
sum: function(arr) { | |
return arr.reduce( (total, num) => total + num, 0); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment