Created
January 29, 2026 07:53
-
-
Save trycf/fd1453abd8f59f7ff55889e8b9fa2217 to your computer and use it in GitHub Desktop.
TryCF Gist
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <cfscript> | |
| boolean function isBool(any val) { | |
| return isValid("boolean", arguments.val); | |
| if (!isBoolean(arguments.val)) return false; | |
| // if (isString(arguments.val)) return false; | |
| return (arguments.val == true || arguments.val == false); | |
| } | |
| values = [ | |
| "yes", | |
| "no", | |
| 1, | |
| 0, | |
| true, | |
| false | |
| ]; | |
| for (i=1; i<=arrayLen(values); i++) { | |
| writeOutput("<p>#values[i]# : #isBool(values[i])#</p>"); | |
| } | |
| </cfscript> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment