Retired

Use reduce() to calculate the sum of the values in an array (retired)

6,062 of 6,124FesterBesterTester

Description:

Make the sum() function return the sum of the values in the passed in array. Your solution must use the reduce() function of the built-in javascript Array object. If you're not familiar with reduce(), reading over the documentation may help.

function sum(array) {
  // Use array.reduce() to find and return the
  // sum of the values in array.
}

For example:

var someNumbers = [1,2,3,4,5,6,7,8,9,10];

sum(someNumbers); // should return 55
Arrays
Functional Programming
Fundamentals

Stats:

CreatedMar 20, 2014
Warriors Trained7621
Total Skips386
Total Code Submissions11305
Total Times Completed6124
JavaScript Completions6062
Total Stars52
% of votes with a positive feedback rating91% of 427
Total "Very Satisfied" Votes363
Total "Somewhat Satisfied" Votes54
Total "Not Satisfied" Votes10
Ad
Contributors
  • FesterBesterTester Avatar
  • jhoffner Avatar
Ad