DEV Community

Discussion on: Polyfill for Array.reduce() Javascript

Collapse
 
melvdouc profile image
Melvin DOUCET • Edited

let accumulator = initialValue === undefined ? undefined : initialValue;

In other words:
let accumulator = initialValue;