Created
May 18, 2010 18:04
-
-
Save infynyxx/405307 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
a = function () { | |
for (var i = 0; i < 5; i++) { | |
print(i); | |
} | |
} | |
//expected: print 0 to 4 | |
//value: prints entire function instead of executing it |
ok! that was a dumbest mistake
no worries - glad it makes sense now :)
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
this prints the entire function because you never call it. so it just prints the result of the last statement/expression, which is the variable a itself. if you then do:
you will get the results printed. I don't think anything else makes sense here - you're defining the function not calling it.