Created
December 2, 2012 03:39
-
-
Save atuttle/4186852 to your computer and use it in GitHub Desktop.
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> | |
_ = new underscore(); | |
fail = _.range(10); | |
writeDump(var=fail, label="_.range(10)"); | |
customRange = []; | |
start = 0; | |
step = 1; | |
i = 1; | |
while (i <= 10){ | |
customRange[i] = start; | |
start += step; | |
i++; | |
} | |
writeDump(var=customRange, label="custom while loop with i++ moved OUT of assignment"); | |
customRange = []; | |
start = 0; | |
step = 1; | |
for (i = 1; i <= 10; i++){ | |
customRange[i] = start; | |
start += step; | |
} | |
writeDump(var=customRange, label="for loop"); | |
</cfscript> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment