dropRight method

List<T?> dropRight([
  1. int n = 1
])

Implementation

List<T?> dropRight([int n = 1]) {
  if (n > 0) {
    if (n > length) {
      n = length;
    }
    for (var i = 1; i <= n; i++) {
      removeLast();
    }
  }
  return this;
}