I am studying javasript and trying to write a small program to find a sum of an element in some arrays. For example, they gave us some arrays like this
[
{ name: 'shoe', amount: 100 },
{ name: 't shirt', amount: 200 },
{ name: 'hat', amount: 400 }
]
expect is 700
I must use array reduce method to solve this problem. Could you please give me some ideas for this problem?
Thank you very much for your time.