T
T
T3R3AND2020-02-19 20:34:58
JavaScript
T3R3AND, 2020-02-19 20:34:58

node.js summary?

Tell me there is such a function "Summary". And how can I make it according to a certain parameter.
For example, I have: users.length.
And I also want users.group.lengthto count users of group 1 only.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
T
T3R3AND, 2020-02-19
@T3R3AND

Solution: users.filter(user => user.group === 1).length
Thanks: @hzzzzl

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question