toNumber
Converts a value to a number.
Thin wrapper over Number(value) — kept as a stable surface so callers
don't depend directly on the global constructor's semantics (which have
shifted in the past, e.g. Number(BigInt), and may again).
Usage
toNumber(value: unknown)
Converts a value to a number.
Thin wrapper over Number(value) — kept as a stable surface so callers
don't depend directly on the global constructor's semantics (which have
shifted in the past, e.g. Number(BigInt), and may again).
Parameters
valueunknownrequired
the value to convert.
Returns
the input value converted using JavaScript number coercion.