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>
function myFunction()
{
var res = “”;
res = res + Number.isFinite(0 / 0);
document.getElementById(“demo”).innerHTML = res;
}
</script>

What will be the output of the following JavaScript code?
<p id=”demo”></p>
<script>
function myFunction()
{
var res = “”;
res = res + Number.isFinite(0 / 0);
document.getElementById(“demo”).innerHTML = res;
}
</script>
a) 3
b) true
c) false
d) error

Answer: c
Explanation: The Number.isFinite() method determines whether a value is a finite number. The above code results into an infinte number therefore the output will be false.

Join The Discussion