Creates a reducer function that uses the first element of the iterable as the initial value. Similar to reduce but doesn't require an explicit initial value.
Element type
Function that combines the accumulated result with each element and its index in the input
A function that reduces an iterable using the first element as initial value
If the input iterable is empty
G.pipe( G.range(1, 5), G.reduce1((acc, val) => acc + val)) // 15 Copy
G.pipe( G.range(1, 5), G.reduce1((acc, val) => acc + val)) // 15
Creates a reducer function that uses the first element of the iterable as the initial value. Similar to reduce but doesn't require an explicit initial value.