reduce method

E reduce(
  1. E combine(
    1. E value,
    2. 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);
}