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]) [1,2,3,4].reduce((a,b) => Math.max(a,b),100)
// or
Math.max(...[1,2,3,4])No comments yet.