Version: v0.8.1 - Beta.  We welcome contributors & feedback.

String.isNumeric

isNumeric() -> boolean

Description

Return true if the string represents a valid number value.

Use toNumber to convert the string to a number type.

'123'.isNumeric()
//= true

'-5'.isNumeric()
//= true

'abc'.isNumeric()
//= false

See Also