Skip to content

toInt

Basic usage

The _.toInt function will do its best to convert the given value to an int.

import { toInt } from 'radash'
toInt(0) // => 0
toInt(null) // => 0
toInt(null, 3) // => 3