I know and I am seeing that it isn’t working but why it is returning the whole object instead of amount what is curr value in the reduce function now. these explanation is not present in the w3school.com
if you don’t set a starting value, the starting value of the reducer is the first element in the array, as there are no other values to iterate through, it just returns it
If you want to learn about the Reduce method I would suggest you read the MDN page, not w3schools. They do not even come close to being equivalent.
Using reduce to extract a single value from an object doesn’t make much sense. But as said all you need is a starting value and to do the addition to the correct values.