Created
January 29, 2026 07:51
-
-
Save trycf/3208c7a2f73c07fecb3de7c6e2949009 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) { | |
| 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