First two statements, We used the MAX() Function directly on both the Positive integer and negative integer. Next two statements, We used the MAX() Function directly on both the Positive and negative decimals.

From the above screenshot you can observe that, JavaScript MAX() Function is returning output.

Next, We used the MAX() Function on String value. Following statement will convert the “3” and “19” to integers and return the output.

document.getElementById("Str").innerHTML = Math.max(2, "3", "19", 9);

Next statement, We tried MAX() Function on String value “String”. As we said before, this will return NaN (Not a Number) as output

document.getElementById("Str1").innerHTML = Math.max(2, "String");

Here, we used MAX() Function along with Nullvalue. Within this statement, the null argument is converted to Zero.

document.getElementById("Null").innerHTML = Math.max(4, null, 5, 28);

Last, We tried JavaScript max Function without arguments (Zero arguments). As we said before, this will return Negative Infinite