I previous asked how to import variables values from one JS file into another and perhaps this example may make it more clear as what I am trying to achieve.
//NumbersFile.js
myfirstnumbersarray = new Array();
myfirstnumbersarray[0] = ThisChangingValue;
Now I have a populated array in my NumbersFile.js (12,89,54,23,11 ...& so on), in a second JS file called AddThemUp.js, I want to import the values of myfirstnumbersarray and perform a simple addition function.
//AddThemUpFile.js
//I want to add myfirstnumbersarray[0]+myfirstnumbersarray[3]
var sum1 = myfirstnumbersarray[0]+myfirstnumbersarray[3];
(var sum1 should equal 66 (12+54))
How does myfirstnumbersarray get imported into the AddThemUp file.js, thanks....