I have two variables with their respective values:
lat = ["-100.41812896728515","-100.41812896728517","-100.41812896728519"]
lng = ["20.62346622550882","20.623466225508828","20.623466225508828"]
What I want is to unite both that is of the following form:
nuevo_array = [
["-100.41812896728515","20.62346622550882"],
["-100.41812896728517","20.623466225508828"],
["-100.41812896728519","20.623466225508828"],
]
So far I have the following:
cords = [];
// console.log("coord : " + typeof(lat));
for (let index = 0; index < lat.length; index++) {
cords.push([parseFloat(lat[index]), '']);
for (let index2 = 0; index2 < lng.length; index2++) {
cords.push([cords[index], parseFloat(lng[index2])])
}
}
What would be the proper way to achieve this?