Answers for "sum all valuesarray javascript"

2

typescript sum all array values

const sum = receiptItems.reduce((sum, current) => sum + current.total, 0);
Posted by: Guest on November-16-2020
-1

how to add all values of array together js

function addArrayNums(arr) {
	let total = 0;
	for (let i in arr) {
      total += arr[i];
    }
  return total;
}
Posted by: Guest on January-03-2021

Code answers related to "sum all valuesarray javascript"

Code answers related to "TypeScript"

Browse Popular Code Answers by Language