타이프 라이터 합계 모든 값 배열
const sum = receiptItems.reduce((sum, current) => sum + current.total, 0);
는 방법을 찾기 위해 합의 배열을 사용하여 JavaScript
// If you do not want to use array.reduece you can itereate through the array and then get the solution.
const getSum = (arr)=>{
let sum = 0;
for(key of arr){
sum += key
}
return sum
}