Created
November 12, 2017 16:57
-
-
Save vineeshnp/7abdb1c36197b9f0fb65052ea0c93937 to your computer and use it in GitHub Desktop.
Sum of an array in Javascript
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 arr = [1, 2, 4, 5, -3] | |
var sum = arr.reduce((a, b) => a + b, 0); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment