Having difficulty understanding the current situation, it appears there may be a syntax problem. Just to provide some context, I am relatively new to Javascript but have previous experience with AS3.
Looking at this code:
https://github.com/mrdoob/three.js/blob/master/examples/canvas_lines.html
Specifically, line 34 shows:
camera, scene, renderer;
Initially, I assumed these were global variable declarations and that in line 42, they were local declarations within the init() function.
Line 42 reads:
particles, particle;
Upon experimenting with the code, I noticed that declaring the particle object globally as shown caused the script to fail. However, it worked properly when declared as follows:
var particle;
In addition, removing line 42 also fixed the issue.
What is the reason behind this behavior? Can someone please explain what's happening?
Thank you!