isNumeric
isNumeric(x)
Test whether a value is a numeric value. Returns true when the input is a number, BigNumber, Fraction, or boolean.
Try it yourself:
$1 | isNumeric(2)
| |
$2 | isNumeric("2")
| |
$3 | hasNumericValue("2")
| |
$4 | isNumeric(0)
| |
$5 | isNumeric(bignumber(500))
| |
$6 | isNumeric(fraction(0.125))
| |
$7 | isNumeric(2 + 3i)
| |
$8 | isNumeric([2.3, "foo", false])
|