Created
September 27, 2012 17:17
-
-
Save bittersweetryan/3795224 to your computer and use it in GitHub Desktop.
null in a structure
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> | |
myStruct = { | |
def : "defined", | |
undef : javaCast("null","") | |
}; | |
writedump(var=myStruct,output="browser"); | |
writeOutput("<br>"); | |
writeDump(structKeyExists(myStruct,"undef")); | |
writeOutput("<br>"); | |
try{ | |
isNull(myStruct["undef"]); | |
} | |
catch(any ex){ | |
writedump(var=ex.message,output="browser"); | |
} | |
</cfscript> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment