Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- const newNumbers = [1, 3, 5, 7];
- const newSum = newNumbers.reduce((accumulator,currentValue) =>
- {
- console.log('The value of accumulator: ', accumulator);
- console.log('The value of currentValue: ', currentValue);
- return currentValue+ accumulator;
- //second arg
- },10);
- console.log(newSum);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement