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
|
* @returns {number} Sum of the numbers
|
||||||
*/
|
*/
|
||||||
function sumReduce(array) {
|
function sumReduce(array) {
|
||||||
return array.reduce(function(curr, prev) {
|
return array.reduce(function(prev, cur) {
|
||||||
return curr + prev;
|
return prev + cur;
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user