Advertisement
Guest User

Untitled

a guest
Oct 17th, 2019
113
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.28 KB | None | 0 0
  1. const newNumbers = [1, 3, 5, 7];
  2.  
  3. const newSum = newNumbers.reduce((accumulator, currentValue) => {
  4. console.log('The value of accumulator: ', accumulator);
  5. console.log('The value of currentValue: ', currentValue);
  6. return accumulator + currentValue;
  7. }, 10);
  8.  
  9.  
  10. console.log(newSum);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement