This functionality is only available for certain module packages.

intoInject(Block expession,Object startValue)

Accumulates a current value by evaluating expression.

intoInject(Block expession,Object startValue)
Arguments Block expression Expression that should be applied to all objects in the collection.
Object startValue Start value of the accumulation.
Return value Object Result of the accumulation

Description for the example 1:

Data in this example

Index number of iteration Index variable indexValue Intermediate value startValue Result value for indexValue + startValue
1 10 0 10
2 11 10 21
3 12 11 33

intoInject is used in practice, e.g., to apply Maps whose key-value pairs contain lists as values.

The following example shows how signal names are collected in a project and sorted in a map depending on their signal type.