Intervals: [start_0: number, end_0: number | undefined, start_i_end_i: (number | undefined)[]]

represents intervals at which slices should be performed by sliceIntervals.

  • every even element dictates a start index, which should be:
    • a positive number
  • every odd element dictates the subsequent end index, which can one of:
    • a positive number
    • a negative number, for reverse indexing
    • or undefined, for last element (inclusive) indexing
// mathematically represents the set of intervals: { [0, 10), [20, 30), [90, Inf), [15, arr.length - 15) }
const my_intervals: Intervals = [0, 10, 20, 30, 90, undefined, 15, -15]