r/shittyprogramming • • Mar 10 '23

Javascript is hard sometimes

Post image
504 Upvotes

64 comments sorted by

View all comments

Show parent comment

2

u/EsperSpirit Mar 10 '23

Yeah and if you don't provide a default value for reduce it would crash on empty strings, which is a common edge case people forget about.

They clearly know what they are doing.