dropRight method
Return a new collection with the last n elements removed.
Implementation
@override
IList<A> dropRight(int n) {
if (isEmpty) {
return this;
} else {
final lead = iterator.drop(n);
final it = iterator;
final res = builder<A>();
while (lead.hasNext) {
res.addOne(it.next());
lead.next();
}
return res.toIList();
}
}