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
Similar Kata:
Stats:
Created | Mar 20, 2014 |
Warriors Trained | 7621 |
Total Skips | 386 |
Total Code Submissions | 11305 |
Total Times Completed | 6124 |
JavaScript Completions | 6062 |
Total Stars | 52 |
% of votes with a positive feedback rating | 91% of 427 |
Total "Very Satisfied" Votes | 363 |
Total "Somewhat Satisfied" Votes | 54 |
Total "Not Satisfied" Votes | 10 |