toInt 157 bytes
Convert a value to an int if possible
Usage
The _.toInt
function will do its best to convert the given value to an int.
import * as _ from 'radashi'
_.toInt(0) // => 0_.toInt(null) // => 0_.toInt(null, 3) // => 3