2D array as global variable

the_math-hobbyist shared this question 7 months ago
Needs Answer

Hi.

I have some applets with JavaScript global 2D arrays (see an example in the attachment).

They seem to work fine (even other more complex applets).


However, I have realized that the global variables are a bad practice on JavaScript programming for GeoGebra:


https://wiki.geogebra.org/en/Scripting

https://help.geogebra.org/topic/javascrit-global-variable


Should I change the JavaScript arrays to GeoGebra lists? (the JavaScript arrays would save me some steps forward [and the rewriting process].)

Comments (2)

photo
1

Could I follow using JavaScript global arrays? (improving my question)

photo
1

I found this thread:


https://help.geogebra.org/t...


ggbApplet.myGlobal = 1;


Works in GeoGebra 6 for scalar numbers. It doesn't work for arrays.

© 2020 International GeoGebra Institute