Array Push
Module Info:
moduleType: "internal",
moduleName: "push"
Description
The push
function inserts an item in an array or into a new one if no existing array is given.
Inputs
Name | Type | Required |
---|---|---|
targetArray | Array<any> | ✖ (Default: [] ) |
newItems | object | ✖ (Default: {} ) |
item | any | ✖ (Default: undefined ) |
Do note that even though none of the inputs are required, giving no inputs to the function will result in the push
function simply returning an empty array.
Outputs
Name | Type |
---|---|
result | number |
Examples
Inputs | Outputs |
---|---|
array | result |
[ "first", "second", "third" ] | 3 |
[ "first", "second", "third", "fouth" ] | 4 |
[ 4, "test", "foo" ] | 3 |