Last active
August 29, 2015 13:57
-
-
Save adamcameron/9852135 to your computer and use it in GitHub Desktop.
Demonstrating bug in Railo
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
<cfscript> | |
numbers = [1,2,3,4] | |
iterations = 0 | |
numbers.each(function(v,i){ | |
iterations++ //unscoped | |
echo("#iterations#<br>") | |
}); | |
echo("<hr>") | |
iterations = 0 | |
numbers.each(function(v,i){ | |
variables.iterations++ // now with scoping | |
echo("#iterations#<br>") | |
}); | |
</cfscript> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment