What is negative infinity In Javascript?

Forums JavaScriptWhat is negative infinity In Javascript?
Staff asked 3 years ago

Answers (1)

Add Answer
Nayan Raval Marked As Accepted
Staff answered 3 years ago

In JavaScript, Negative Infinity is a number that may be obtained by dividing a negative number by zero. Consider the following scenario:

var num=-5;  
function display()  
{  
  document.writeln(num/0);  
}  
display();  
//expected output: -Infinity

 

Subscribe

Select Categories