A
Q. JavaScript _________ when there is an indefinite or an infinite value during an arithmetic computation.
- Correct Answer - Option(D)
- Views: 5
- Filed under category JavaScript
- Hashtags:
A
In JavaScript, when an arithmetic computation results in an indefinite or infinite value, JavaScript does not throw an error. Instead, it returns Infinity (or -Infinity for negative values).
Example:
console.log(10 / 0); // Output: Infinity
console.log(-10 / 0); // Output: -Infinity
If the result of a computation is undefined (like 0/0), JavaScript returns NaN (Not-a-Number):
console.log(0 / 0); // Output: NaN
Why Not Other Options?
Final Answer:
✅ (D) Displays “Infinity”
You must be Logged in to update hint/solution
Be the first to start discuss.
Discusssion
Login to discuss.