InsertAction

ArrayActions. InsertAction

An action "insert" that inserts an 'item' or 'items' into an array property or variable, at a given index.

Constructor

new InsertAction()

Source:
Examples
{
     /Insert "myNewItem" at index 2, in the array at myArrayProperty
    "insert": {
        "to": {"property": "myArrayProperty"},
        "index": 2,
        "item": "myNewItem"
    }
}
{
     /Insert "myNewItem" at index 2, in the array at myVariableArray
    "insert": {
        "to": {"variable": "myVariableArray"},
        "index": 2,
        "item": "myNewItem"
    }
}
{
     /Insert multiple items at index 3, in the array at myVariableArray
    "insert": {
        "to": {"variable": "myVariableArray"},
        "index": 3,
        "items": ["myNewItem", "mySecondNewItem"]
    }
}