Skip to content

petite-utilsDocs


函数: isNumerical()

isNumerical(value): boolean

参数

参数名类型描述
valueany要检查的值,可以是任何类型

返回值

boolean

如果是数字或可转换为有效数字的字符串,则返回 true,否则返回 false

Description

检查给定的值是否为数值,包括数字、字符串数字 和 BigInt 此外,如果给定值是一个非空字符串,它将尝试将其转换为数字并检查其有效性

源码

type/type.ts:120

Released under the MIT License.