import { isNumeric } from "https://deno.land/x/ayonli_jsext@v0.9.72/number/index.ts";
Returns true
if the given value is a numeric value, false
otherwise. A numeric value is a
number, a bigint, or a string that can be converted to a number or bigint.
NOTE: NaN
is not considered numeric.
Examples
Example 1
Example 1
import { isNumeric } from "@ayonli/jsext/number";
console.log(isNumeric(42)); // true
console.log(isNumeric(42n)); // true
console.log(isNumeric("42")); // true
console.log(isNumeric(NaN)); // false
console.log(isNumeric(42n, true)); // false
console.log(isNumeric("42", true)); // false