Let's look at the specifications (which could / should have helped you with the implementation!)
In ECMAScript 1st Edition (ECMA-262) (initial definitions for Math.max / min), we see the following:
15.8.2.11 max(x, y) Returns the larger of the two arguments. โข If either argument is NaN, the result is NaN. โข If x>y, the result is x. โข If y>x, the result is y. โข If x is +0 and y is +0, the result is +0. โข If x is +0 and y is โ0, the result is +0. โข If x is โ0 and y is +0, the result is +0. โข If x is โ0 and y is โ0, the result is โ0. 15.8.2.12 min(x, y) Returns the smaller of the two arguments. โข If either argument is NaN, the result is NaN. โข If x<y, the result is x. โข If y<x, the result is y. โข If x is +0 and y is +0, the result is +0. โข If x is +0 and y is โ0, the result is โ0. โข If x is โ0 and y is +0, the result is โ0. โข If x is โ0 and y is โ0, the result is โ0.
Later versions of the specification give us:
ECMAScript 5.1
15.8.2.11 max ( [ value1 [ , value2 [ , โฆ ] ] ] ) Given zero or more arguments, calls ToNumber on each of the arguments and returns the largest of the resulting values. โข If no arguments are given, the result is โโ. โข If any value is NaN, the result is NaN. โข The comparison of values to determine the largest value is done as in 11.8.5 except that +0 is considered to be larger than โ0. The length property of the max method is 2. 15.8.2.12 min ( [ value1 [ , value2 [ , โฆ ] ] ] ) Given zero or more arguments, calls ToNumber on each of the arguments and returns the smallest of the resulting values. โข If no arguments are given, the result is +โ. โข If any value is NaN, the result is NaN. โข The comparison of values to determine the smallest value is done as in 11.8.5 except that +0 is considered to be larger than โ0. The length property of the min method is 2.
Link to 11.8.5 is given here: Abstract Relational Comparison Algorithm
ECMAScript 2015
20.2.2.24 Math.max ( value1, value2 , โฆvalues ) Given zero or more arguments, calls ToNumber on each of the arguments and returns the largest of the resulting values. โข If no arguments are given, the result is โโ. โข If any value is NaN, the result is NaN. โข The comparison of values to determine the largest value is done using the Abstract Relational Comparison algorithm (7.2.11) except that +0 is considered to be larger than โ0. The length property of the max method is 2. 20.2.2.25 Math.min ( value1, value2 , โฆvalues ) Given zero or more arguments, calls ToNumber on each of the arguments and returns the smallest of the resulting values. โข If no arguments are given, the result is +โ. โข If any value is NaN, the result is NaN. โข The comparison of values to determine the smallest value is done using the Abstract Relational Comparison algorithm (7.2.11) except that +0 is considered to be larger than โ0. The length property of the min method is 2.
Again 7.2.11 can be found here: Abstract relational comparison