operator * method

  1. @Possible({RangeError})
  2. @useResult
List<E> operator *(
  1. int times
)

Repeats this list the give number of times.

Contract

A RangeError is thrown if times is negative.

Implementation

@Possible({RangeError})
@useResult List<E> operator * (int times) {
  RangeError.checkNotNegative(times, 'times');
  return [ for (var i = 0; i < times; i++) ...this ];
}