Add the contents of an array together

PHOTO EMBED

Thu Sep 15 2022 14:19:47 GMT+0000 (Coordinated Universal Time)

Saved by @csmith66 #javascript

 NEW VARIABLE = ARRAY TO ADD.reduce((accumulator, value) => {
  return accumulator + value;
}, 0);
content_copyCOPY

https://bobbyhadz.com/blog/javascript-get-sum-of-array-of-numbers#:~:text=To%20get%20the%20sum%20of,value%20and%20the%20current%20number.