operator >> method

List<E> operator >>(
  1. int count
)

Returns an List that has been removed by the number of count from the end.

If count is negative it throws ArgumentError.

It is not in the Kotlin collection library. But I added it because it looks useful.

Implementation

List<E> operator >>(int count) => count.isNegative
    ? throw ArgumentError.value(count, 'count', 'Cannot be negative')
    : count > length
        ? []
        : sublist(0, length - count);