So you're telling me that functions that determaine the minimum and maximum values of two numbers return something weird when you don't give it any numbers? Really makes you think.
(Also btw, if one or more of the parameters aren't numbers you get NaN, which makes pretty good sense tbh)
Math.max() has nothing to do with the type system. It's an overloaded function that's clearly described in the docs. It should output negative Infinity (a number) because that's what the function docs say it will do if it is called without a number.
If you're dicking around with type coercion, you've probably made a mistake somewhere.
View all comments
Show parent comment
4
u/inabahare Jun 21 '18
So you're telling me that functions that determaine the minimum and maximum values of two numbers return something weird when you don't give it any numbers? Really makes you think.
(Also btw, if one or more of the parameters aren't numbers you get NaN, which makes pretty good sense tbh)