The JavaScript exception "BigInt division by zero" occurs when a BigInt
is divided by 0n
.
The JavaScript exception "BigInt division by zero" occurs when a BigInt
is divided by 0n
.
Instead, check if the divisor is 0n
first, and either issue an error with a better message, or fallback to a different value, like Infinity
or undefined
.
© 2005–2023 MDN contributors.
Licensed under the Creative Commons Attribution-ShareAlike License v2.5 or later.
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Errors/BigInt_division_by_zero