Skip to content

Instantly share code, notes, and snippets.

@mgmgpyaesonewin
Last active May 9, 2018 07:42
Show Gist options
  • Save mgmgpyaesonewin/430c00210a20ab35eec6bd62b49b161e to your computer and use it in GitHub Desktop.
Save mgmgpyaesonewin/430c00210a20ab35eec6bd62b49b161e to your computer and use it in GitHub Desktop.
Finding the total number of item in a array
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