xxxxxxxxxx
const arr = [1, 2, 3, 4, 5];
/**
0 is initial value for accumulator,
if not defined it starts with last element of array (5)
**/
const result = arr.reduceRight((accumulator, currentValue) => {
return accumulator - currentValue
}, 0);
console.log(result); // -15