Well, of course above methods seems simpler for finding min/max but one should not underestimate the power of reduce in JavaScript. There are several technique where you can solve problems mostly in one reduce statements only.
But in this case a helper method that does the full job exists so why bother with reduce for this use case? I admittedly do not use it enough but just saying
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.
Well, of course above methods seems simpler for finding min/max but one should not underestimate the power of reduce in JavaScript. There are several technique where you can solve problems mostly in one reduce statements only.
But in this case a helper method that does the full job exists so why bother with reduce for this use case? I admittedly do not use it enough but just saying