4 ms·
"OR" was just my (bad) way to explain it. In plain English: if isInteger(x) is true, x is definitely a `number` if isInteger(x) is false, x is unknown/unalter
by HeavyFeather 4y ago
"OR" was just my (bad) way to explain it. In plain English:
if isInteger(x) is true, x is definitely a `number`
if isInteger(x) is false, x is unknown/unaltered (it remains `typeof x`)
Current type guards can't express "yes versus maybe", so isInteger cannot be a type guard at all.