reduce method
E
reduce(
- E combine(
- E value,
- E element
Reduces this to a single value by iteratively combining its elements using combine
.
If this is empty, then a LinkedListException.noElement is thrown.
If this has only one element, it is returned.
Implementation
E reduce(E Function(E value, E element) combine) {
if (isEmpty) throw LinkedListException.noElement();
return content.reduce(combine);
}