subtract method

N subtract({
  1. required N ifEmpty,
})

Returns the subtraction of all values in this iterable. If the iterable is empty, this function returns the specified ifEmpty parameter.

Implementation

N subtract({
  required N ifEmpty,
}) =>
    isEmpty ? ifEmpty : reduce((value, element) => (value - element) as N);