what I need to do is to be able to pass some array
that are in different functions to a "final" function , I really don't know where to start because I have no idea how to do it.
the original code is very extensive for this reason I created some examples that more or less is what they do.
//#######################################################
function funcion1(){
var array1 = [0, 1, 2, 3, 4, 5]
var receptor=[]
receptor.push(array1)
}
funcion1()
//#######################################################
function funcion2(){
var receptor = [];
var array2 = []
var condicion;
if(condicion = true){
array2 = [0, 1, 2, 3, 4, 5]
}else{
array2 = [5, 4, 3, 2, 1, 0]
}
receptor.push(array2)
}
funcion2()
//#######################################################
//Función objetivo
function objetivo(receptor){
var rec = receptor
// console.log(rec) = [array1, array2,....]
}
objetivo()
Well, as you can see, function1 and function2 have
arreglos
the data that I want to pass to the final function.
There are several ways, but this solves what you want to do: