Less than 1 minute
Home > @hz-9/algorithm > defaultToNumber
defaultToNumber() function
Convert any type to a number. This function should ensure that different objects in the target dataset are not converted to the same number.
将任意类型转换为数字。 此函数应保证目标数据集中不同对象不会被转换为相同数字。
Signature:
defaultToNumber: <T>(val: T) => numberParameters
Parameter | Type | Description |
|---|---|---|
val | T | The value to convert |
Returns:
number
The converted number