|
|
|
|
|
by goto11
1772 days ago
|
|
It is a typical language-comparison strawman. He is writing list.reduce((x,y)=>Math.max(x,y))
To get the max number in a list. And he is "winching" because he can't write: list.reduce(Math.max)
Because the variable arity of max does not play well with reduce. But because of the variable arity he can write: Math.max(...list)
Which is even simpler.So he deliberately writes overly complex JavaScript code to show how the other language is more concise. |
|
So worthwhile keeping in mind that the nice JS code falls apart.