Description

Determines whether a value can be converted to Boolean.

Returns

True, if the parameter can be converted to Boolean; False, otherwise.

Category

Function syntax

IsBoolean(object)

See also

History

ColdFusion (2018 release): Introduced named parameters.

Parameters

Parameter

Description

object

Can take any value or a variable containing one.

Example

<cfscript>
       WriteOutput(isBoolean(12)); // returns Yes
       WriteOutput(isBoolean("yes")); // returns Yes
       WriteOutput(isBoolean("no")); // returns Yes
       WriteOutput(isBoolean(0)); // returns Yes
       WriteOutput(isBoolean(true)); // returns Yes
       WriteOutput(isBoolean(false)); // returns Yes
       WriteOutput(isBoolean("hello")); // returns No
       bool_val = true;
       WriteOutput(isBoolean(bool_val)); // returns Yes
</cfscript>

This work is licensed under a Creative Commons Attribution-Noncommercial-Share Alike 3.0 Unported License  Twitter™ and Facebook posts are not covered under the terms of Creative Commons.

Legal Notices   |   Online Privacy Policy