Skip to content

Latest commit

 

History

History
33 lines (22 loc) · 922 Bytes

array_clear.md

File metadata and controls

33 lines (22 loc) · 922 Bytes

Home > Community Toolbox Reference > Array utilities > Basic operations

array_clear

Go to source

Removes all items from the array.

Arguments
Argument Type Usage Description
array Array Required The array to clear.
Returns

N/A

Example

The following code clears pending dialogue commands before adding new ones.

function dialogue_jump(_branch) {
    array_clear(ctrl_Dialogue.pending_commands);
    array_foreach(_branch.commands, function(_command) {
        array_push(ctrl_Dialogue.pending_commands, _command);
    });
}

Update history

  • 24.6.0 - Created a function to clear arrays.