JavaScript Developer — Medium
Key points
- Calling reduce() on an empty array without an initial value throws a TypeError
- An initial value is needed to start the reduction process
- This behavior is designed to avoid potential errors or unexpected outcomes
Ready to go further?
Related questions
