// How to Subtract the numbers in the array, starting from the right in javascript
let numberSubtractRight = [100, 25, 100];
let resultSubtractRight = numberSubtractRight.reduceRight((a, b) => a - b);
console.log(resultSubtractRight);
// How to Subtract the numbers in the array, starting from the left in javascript
let numberSubtract = [325, 25, 100];
let resultSubtract = numberSubtract.reduce((a, b) => a - b);
console.log(resultSubtract);