This code is used for finding the cumulative sum of an array [5, 10, 3, 3] i.e.
output = [5,15,18,21]
here everything is correct i just want to know the meaning of this line
(sum => value => sum += value)(0)
anybody who knows this ?
const cumulativeSum = (sum => value => sum += value)(0);
console.log([5, 10, 3, 2].map(cumulativeSum));