3 ms·
Not disagreeing with your overall point, but JS can also do it more succintly: [1,2,3,4].reduce((a,b) => Math.max(a,b),100) // or Math.max(...[1,2,3,4])
by nvlled 2y ago
Not disagreeing with your overall point, but JS can also do it more succintly:
[1,2,3,4].reduce((a,b) => Math.max(a,b),100)
// or
Math.max(...[1,2,3,4])