Generates a bag which includes the objects specified by expression.
| collect(Block expression) | |||
|---|---|---|---|
| Argument | Block | expression | Expression that is applied to all objects in the collection. |
| Return value | Bag | Bag with the results which arise by executing of the expression. | |
| Formula | Result |
|---|---|
| =Map{Pair{'A',1}, Pair{'B',2}}.collect(x|x.value) | [1, 2] |
