@jossmac/lil-libs
    Preparing search index...

    Function isAscending

    • Checks whether an array is in ascending order (allowing equal neighbouring values).

      • items: number[]

        Array of numbers to compare pairwise.

      true when each element is greater than or equal to the previous; arrays of length 0 or 1 always pass.

      isAscending([1, 1, 2, 3]); // true
      isAscending([3, 2, 1]); // false
      isAscending([]); // true (0- and 1-element arrays pass)