Skip to content

Latest commit

 

History

History
33 lines (22 loc) · 923 Bytes

array_empty.md

File metadata and controls

33 lines (22 loc) · 923 Bytes

Home > Community Toolbox Reference > Array utilities > Basic operations

array_empty

Go to source

Checks if the given array has no items.

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

Bool

Example

The following code chooses the next target from the array, or undefined if none is available.

function get_next_target() {
    if (array_empty(global.available_targets))
        return undefined;
    else
        return array_shift(global.available_targets);
}

Update history

  • 24.6.0 - Created a function to check if an array is empty.