Register Now

Login

Lost Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

What will be the output of the following JavaScript code?
<p id=”demo”></p>
<script>
document.getElementById(“demo”).innerHTML = Math.min(0, 150, 30, 20, -8, -200);
</script>

What will be the output of the following JavaScript code?
<p id=”demo”></p>
<script>
document.getElementById(“demo”).innerHTML = Math.min(0, 150, 30, 20, -8, -200);
</script>
a) 0
b) -8
c) -200
d) 20

Answer: c
Explanation: Math.min() returns the lowest value in a list of arguments. The lowest value is -200, hence the output will be -200.

Join The Discussion