When dividing in JS you get Infinity if you divide by zero, I want to change that behavior by returning undefined so I can identify a real Infinity vs. an error result.
Assuming that writing the next line calls some math or build-in function for division:
var a = 6 / 0;
- What is the full name/path of the '/' function ?
- Is there a way to overwrite it (or any other operand)?
A sharpening:
Infinity / 1 = Infinity (the top Infinity is a result from a devision by zero) whereas undefined / 1 = Nan.
Is it possible without writing and using my own function to identify that there was a problem in during the calculation?