Skip to content

Conversation

@aman1106
Copy link

No description provided.

Comment on lines +47 to +50
let total = 0;
counters.forEach(c => {
total = total + c.value;
})
Copy link

@bikkimahato bikkimahato Aug 24, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can use reduce method also.
const total = counters.reduce((acc,el)=>acc+el.value,0);

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants