Infinity Division
Multiple Choice Medium
Question
What does 1 / 0 return in JavaScript?
Hint
JavaScript uses IEEE 754 which defines division by zero.
Explanation
1 / 0 returns Infinity in JavaScript. Unlike many languages that throw an error, JavaScript follows IEEE 754 floating point rules where division of a positive number by zero gives positive Infinity. -1 / 0 gives -Infinity, and 0 / 0 gives NaN.
Related Resources
Related Lessons
- Numbers and Math
Learn about numbers.
Look up unfamiliar terms
A beginner-friendly glossary explains jargon in plain English — variables, functions, DOM, Promise, and more.
Decode error messages
Plain-English explanations of common errors — what they mean, why they happen, and how to fix them.
Build real projects
Apply what you learned by building guided projects with starter code and solutions.