Skip to content

Instantly share code, notes, and snippets.

@ahmedash95
Created September 21, 2017 23:55
Show Gist options
  • Save ahmedash95/8b66f33179b11f0110e5726d348d1c53 to your computer and use it in GitHub Desktop.
Save ahmedash95/8b66f33179b11f0110e5726d348d1c53 to your computer and use it in GitHub Desktop.
function sum(arrayOfIntegers){
return arrayOfIntegers.reduce((a, b) => a + b, 0);
}
// Example
var integers = [1,2,3,4,5);
sum(integers)
// Result
// 15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment