Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save trycf/2effd5850860f9f0ec56fb4a99780475 to your computer and use it in GitHub Desktop.
Save trycf/2effd5850860f9f0ec56fb4a99780475 to your computer and use it in GitHub Desktop.
TryCF Gist
<cfscript>
system=createOBject('java','java.lang.System')
// "True" test of ===
a=5
b=2+3
dump(a==b)
dump(a===b)
c='test'
d=['te','st'].toList('')
dump(c==d)
dump(c===d)
// Objects being compared are not the same on heap
dump(system.identityHashCode(a))
dump(system.identityHashCode(b))
dump(system.identityHashCode(c))
dump(system.identityHashCode(d))
// Ben's test that doens't do what you think it does
e=5
f=5
dump(e==f)
dump(e===f)
g='test'
h='test'
dump(g==h)
dump(g===h)
// Objects are the same on heap!!
dump(system.identityHashCode(e))
dump(system.identityHashCode(f))
dump(system.identityHashCode(g))
dump(system.identityHashCode(h))
</cfscript>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment