Data hosted with ♥ by Pastebin.com - Download Raw - See Original
  1. const arrayTest = [
  2.  
  3.     {name: 'Silver', experience: 10},
  4.  
  5.     {name: 'Kevin', experience: 5},
  6.  
  7.     {name: 'Happy', experience: 1},
  8.  
  9.     {name: 'Xan', experience: 1}
  10.  
  11. ]
  12.  
  13. let sum = 0;
  14.  
  15. function total(experience) {
  16.  
  17.     return sum += experience
  18.  
  19. }
  20.  
  21. arrayTest.forEach(el => total(el.experience))
  22.  
  23. console.log(sum)