Update 01_loop_sum_reduce_version.js (#235)
changing variables names to correct
This commit is contained in:
@@ -6,8 +6,8 @@
|
||||
* @returns {number} Sum of the numbers
|
||||
*/
|
||||
function sumReduce(array) {
|
||||
return array.reduce(function(curr, prev) {
|
||||
return curr + prev;
|
||||
return array.reduce(function(prev, cur) {
|
||||
return prev + cur;
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user