toInt

Converts the given argument to an int.

Does not support maps or arrays at this time.

Examples

toInt("1") // 1
toInt("1.2") // 1
toInt(123) // 123
toInt(123.4) // 123
toInt(false) // 0
toInt(true) // 1

Last updated