isBoolean

Returns true when a value can be converted to Boolean

isBoolean(value) → returns boolean

Argument Reference

value any
Required

Examples
Sample code invoking the isBoolean function

Yes is considered a boolean that is true

isBoolean("yes")

Expected Result: YES

No is considered a boolean that is false

isBoolean("no")

Expected Result: YES

Maybe is not considered a boolean

isBoolean("maybe")

Expected Result: NO

true is a boolean

isBoolean(true)

Expected Result: YES

false is a boolean

isBoolean(false)

Expected Result: YES

0 is considered a boolean that is false

isBoolean(0)

Expected Result: YES

23 is considered a boolean that is true

isBoolean(23)

Expected Result: YES

Signup for cfbreak to stay updated on the latest news from the ColdFusion / CFML community. One email, every friday.

Fork me on GitHub