What is the output of the arithmetic expression 7 / 0 in JavaScript?
- 0
- Infinity
- NaN (Not-a-Number)
- Error
The output of the arithmetic expression 7 / 0 in JavaScript is Infinity. In JavaScript, dividing a number by 0 results in positive or negative infinity depending on the sign of the numerator. Attempting to divide by 0 does not throw an error, but it produces infinity.
Loading...
Related Quiz
- The _________ method of an XMLHttpRequest object is used to send the request to a server.
- Which statement is true regarding function scope in JavaScript?
- What happens when a function declaration and a var variable are hoisted in the same scope?
- To prevent variables from being added to the global object, it is common to use a(n) _______ function expression.
- If you are developing a real-time application where any blocking of the event loop can lead to critical issues, how might you implement a "for" loop to process an array of data without introducing any blockage?