5
Trithon
23d

My fucking god!! I swear if i meet the guy who implemented Array.reduce in javascript!! I'll tear his god damn head clean off and stuff it down his throat!!

From the spec: "if the initial value is omitted, the first value of the array is used instead and skipped"

WHO TF THOUGHT THIS WOULD BE A GOOD IDEA!?!!?!

One freaking hour that stuff cost me today RRREEEEEEEEEE

# rm -rf $JAVASCRIPT

Please and thank you!

Comments
  • 7
    JavaScript, the language that was never even meant to be used for more than updating some parts of a webpage.
  • 2
    I’m curious as to what use-case you have in which omitting the initial value would be a good idea
  • 2
    Whats wrong with that? It actually makes perfect sence. The initial value is used as an, wel, initial value. You could also use 0. For example, reduce((acc, val) => acc + val) is the same as reduce((acc, val) => acc + val, 0).
  • 8
    @Sauruz This feels like one of those scenarios where the language gets blamed for a miss understanding of core functionality.
  • 1
    That's how reduce works everywhere.
Add Comment