Math.max() is easier to read, and if only run occasionally on small arrays... fine.
Reduce is a little more convoluted, but still can be understood easily enough. The time savings on the code if running frequently or on larger datasets can quickly add up in benefits.
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
Depends what the codes for really.
Math.max()
is easier to read, and if only run occasionally on small arrays... fine.Reduce
is a little more convoluted, but still can be understood easily enough. The time savings on the code if running frequently or on larger datasets can quickly add up in benefits.