教程 radash tutorial

toInt

尽可能将值转换为整数

基本用法

_.toInt函数会尽力将给定的值转换为整数。

ts
import { toInt } from 'radash'

toInt(0) // => 0
toInt(null) // => 0
toInt(null, 3) // => 3