Home » JavaScript » JavaScript Variables » Question
  1. JavaScript _________ when there is an indefinite or an infinite value during an arithmetic computation.
    1. Prints the value as such
    2. Prints an exception error
    3. Prints an overflow error
    4. Displays “Infinity”
    5. None of these
Correct Option: D

When the result of a numeric operation is larger than the largest represent able number (overflow), JavaScript prints the value as Infinity. Similarly, when a negative value becomes larger than the largest represent able negative number, the result is negative infinity. The infinite values behave as you would expect: adding, subtracting, multiplying, or dividing them by anything results in an infinite value (possibly with the sign reversed).



Your comments will be displayed only after manual approval.