Skip to content

Instantly share code, notes, and snippets.

@bennadel
Created March 24, 2014 23:24
Show Gist options
  • Save bennadel/9751529 to your computer and use it in GitHub Desktop.
Save bennadel/9751529 to your computer and use it in GitHub Desktop.
Destroying ColdFusion Variables Using JavaCast()
<!--- Create the objFoo variable. --->
<cfset objFoo = StructNew() />
<cfset objFoo.Bar = "Well Played!" />
<!--- Destroy struct via JavaCast(). --->
<cfset objFoo = JavaCast( "null", 0 ) />
<!--- Dump out variable. --->
<cfdump var="#objFoo#" />
<!--- Create the objFoo variable. --->
<cfset objFoo = StructNew() />
<cfset objFoo.Bar = "Well Played!" />
<!--- Destroy key via JavaCast(). --->
<cfset objFoo.Bar = JavaCast( "null", 0 ) />
<!--- Dump out variable. --->
<cfdump var="#objFoo#" />
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment