Last active
April 4, 2019 15:00
-
-
Save JamoCA/5b20fe32da06d783f6d8636abb92f0f8 to your computer and use it in GitHub Desktop.
Comparison of StructKeyExists vs IsDefined for determining if a multi-level sub-key exists.
This file contains 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
<!--- | |
4/4/2019 Comparison of StructKeyExists vs IsDefined for determining if a multi-level sub-key exists. | |
https://gist.github.com/JamoCA/5b20fe32da06d783f6d8636abb92f0f8 | |
Response to this: https://forums.adobe.com/message/11012233#11012233 | |
Try it here: https://www.trycf.com/gist/5b20fe32da06d783f6d8636abb92f0f8 | |
---> | |
<cfset Test = { | |
House = { | |
Address = { | |
Shipping = 1 | |
} | |
} | |
}> | |
<cfoutput> | |
<h2>StructKeyExists(Test,'House.Address.Shipping')</h2> | |
#StructKeyExists(Test,'House.Address.Shipping')# | |
<h2>isDefined('Test.House.Address.Shipping')</h2> | |
#isDefined('Test.House.Address.Shipping')# | |
</cfoutput> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment