Unshift
Adds a value at the start of an array.
Node id array/unshift
The Unshift node outputs a new array: array with value added as its
first element. The other elements move up by one index.
Inputs
| Name | Type | Default | Notes |
|---|---|---|---|
| array | Array<T> | — | generic |
| value | T | — | generic |
Outputs
| Name | Type | Notes |
|---|---|---|
| array | Array<T> | generic |
Behaviour
- A new array. The connected array is unchanged, so other nodes using it still see it without the new element.
- Nothing connected to
arraycounts as an empty array: the result holds onlyvalue.
Errors
valuemust be connected: being a generic pin, it can't be set in the property inspector.