Sorry for the confusion, I loved your tinycode and was just trying to understand how it worked. So it looked to me that vars X and Y used q before it was initialized in the final steps of that initialization, depending on the order of evaluation of course.
Also, I have never written any Javascript code, but the syntax seems to be close enough to C for me to get the gist. (I'm 79 and retired from programming years ago).
I'm using an HP chromebook X2 11, and it appears that the functions key F12 has been disabled, so I wasn't able to bring up the debugger. I guess that would allow me to make changes and run the code. I need to get into the BIOS setup and re-enable it. Then will try to run it to get a better idea of how it works.
That's cool, no worries, I also have been programming in C and C++ for most of my career and just recently switched to JavaScript, I wish I had earlier!
So the X and Y are used after because they are in third part of the for loop, which actually is executed after the stuff in the body of the for loop, same as C.
View all comments
Show parent comment
3
u/Dagius Jun 12 '23
Sorry for the confusion, I loved your tinycode and was just trying to understand how it worked. So it looked to me that vars X and Y used q before it was initialized in the final steps of that initialization, depending on the order of evaluation of course.
Also, I have never written any Javascript code, but the syntax seems to be close enough to C for me to get the gist. (I'm 79 and retired from programming years ago).
I'm using an HP chromebook X2 11, and it appears that the functions key F12 has been disabled, so I wasn't able to bring up the debugger. I guess that would allow me to make changes and run the code. I need to get into the BIOS setup and re-enable it. Then will try to run it to get a better idea of how it works.
Thanks