I am new to programming. I have 4 functions: function 1,function 2, function 3,function 4. Now, a value is being calculated in each of the first 3 functions. I want to store these 3 values in a global array and use it in the 4th function. Is the following approach correct? :
var array1=[]
function1(){
array1[0]=calculated value1;
}
function2(){
array1[1]=calculated value2;
}
function3(){
array1[2]=calculated value3;
}
This array will be used in the 4th function.
