Types to represent numbers.
The Numeric type is a union of number and bigint. It is useful for cases where a value could be either a regular JavaScript number or a BigInt.
Numeric
number
bigint
const numericNumber: Numeric = 42;const numericBigInt: Numeric = 42n; Copy
const numericNumber: Numeric = 42;const numericBigInt: Numeric = 42n;
Types to represent numbers.
Remarks
The
Numeric
type is a union ofnumber
andbigint
. It is useful for cases where a value could be either a regular JavaScript number or a BigInt.Example