I have a series of Javascript calculations that (only under IE) show Infinity depending on user choices.
How does one stop the word Infinity appearing a
Infinity
A simple n === n+1 or n === n/0 works:
n === n+1
n === n/0
function isInfinite(n) { return n === n/0; }
Be aware that the native isFinite() coerces inputs to numbers. isFinite([]) and isFinite(null) are both true for example.
isFinite()
isFinite([])
isFinite(null)
true