takeLast method
Takes the last count
elements in an iterable.
Implementation
Iterable<T> takeLast(int count) {
if (count < 0) {
throw RangeError.value(
count, 'count', 'The value of "count" cannot be negative.');
}
if (count == 0) {
return Iterable<T>.empty();
}
final length = this.count();
return skip(length - count);
}