Describe negative infinity in JavaScript?

devquora
devquora

Posted On: Jun 05, 2024

 

In JavaScript, the NEGATIVE_INFINITY property symbolizes negative infinity and is a numerical value obtained by dividing a negative number by zero. Essentially, it represents a number that is smaller than any other number. Key properties include:

  • It's a static property, accessible without object instantiation.
  • The value mirrors the negative of the infinity property of the global object.

The values behave differently than the mathematical infinity:

  1. Any positive value, including POSITIVE_INFINITY, multiplied by NEGATIVE_INFINITY is NEGATIVE_INFINITY.
  2. Any negative value, including NEGATIVE_INFINITY, multiplied by NEGATIVE_INFINITY is POSITIVE_INFINITY.
  3. Zero multiplied by NEGATIVE_INFINITY is NaN.
  4. NaN multiplied by NEGATIVE_INFINITY is NaN.
  5. NEGATIVE_INFINITY, divided by any negative value except NEGATIVE_INFINITY, is POSITIVE_INFINITY.
  6. NEGATIVE_INFINITY, divided by any positive value except POSITIVE_INFINITY, is NEGATIVE_INFINITY.
  7. NEGATIVE_INFINITY, divided by either NEGATIVE_INFINITY or POSITIVE_INFINITY, is NaN.
  8. Any number divided by NEGATIVE_INFINITY is zero.

    Related Questions

    Please Login or Register to leave a response.

    Related Questions

    JavaScript Interview Questions

    Explain what is Javascript?

    JavaScript, a dynamic, client-side language, is crucial in modern web development, working alongside HTML and CSS. Its manipulation of the Document Object Model (DOM) enables dynamic content and inter..

    JavaScript Interview Questions

    What close() does in Javascript?

    In JavaScript, the close() method is employed to securely close the current window. To ensure its association with the window object rather than another JavaScript object, employ window.close(). This ..

    JavaScript Interview Questions

    What is the difference between let and var?

    Both var and let are utilized for variable/method declaration in JavaScript. The crucial disparity lies in their scope: var is function-scoped, meaning it's accessible throughout the function it's def..