There is more than one stackoverflow question about how to find the min or max of an array of values in javascript. This is not that question.
I want to know why pas
TL;DR - Math.min()
and Math.max()
don't actually use the this
argument passed to them, it's just a hack to get them to accept an array of arguments, since the native API only specifies a list of variables. .apply()
can accept arrays of arguments, which is why it is used.
My guess is Math
is passed in as the this
argument simply for cleanliness' sake.
Thanks to @Jonathan Lonowski and @Niet the Dark Absol.