set.aggregate()
Aggregate all the elements in the Set.
Description
The aggregate()
method aggregates all Array elements. There is no
ordering expectation.
The source Set isn’t changed.
Return value
Type | Description |
---|---|
Aggregate of the iterable. If the iterable is empty, seed is returned. |
Examples
// `toSet()` converts an Array to a Set.
let set = [1, 2, 3, 4].toSet()
set.aggregate(0, (a, b) => a + b)
10
Is this article helpful?
Tell Fauna how the article can be improved:
Visit Fauna's forums
or email docs@fauna.com
Thank you for your feedback!