• Returns the length of the given array

    Parameters

    • Optionalarray: null | any[] | readonly any[]

      the array to check

    Returns number

    the length of the given array

    getLength([]);    // 0
    getLength(['foo', 'bar']); // 2