In mathematics, division can be thought of as the inverse operation of multiplication. When you divide a number a by another number b, you are essentially trying to find out how many times b can fit into a. However, when you try to divide by zero, you are asking how many times zero can fit into the number a. Since zero has no value, it cannot be used to measure how many times it can fit into any number. This situation creates an undefined or indeterminate state in mathematics.
However, in the context of JavaScript and the IEEE 754 floating-point standard, the division by zero is handled differently. When you divide a positive number (e.g., 1) by zero, the result is Infinity. This is because, according to the IEEE 754 standard, the number system is extended with positive and negative infinities, which allows for the calculation of limits.
Think of it this way: as the divisor approaches zero, the result of the division grows larger and larger without bounds. In other words, the result approaches infinity. This is why, in JavaScript (and other programming languages that follow the IEEE 754 standard), the division of a positive number by zero results in Infinity
x / 0 === Infinity
seems logical to me. – Cockleshell