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

String.isNumber

isNumber() -> boolean

Description

Return true if the string represents a number.

Use toNumber to convert the string to a number type.

'1.23'.isNumber()
//= true

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

'abc'.isNumber()
//= false

See Also