So I have 2 separate 2D array, they are not necessarily the same length, and I want to make an object for each. I made this:
var obj1 = {},
obj2 = {};
for (var i=0; i<arr1.length; i++) {
obj1[arr1[i][1]] = arr1[i][0];
}
for (var j=0; j<arr2.length; j++) {
obj2[arr2[j][1]] = arr2[j][0];
}
My question is if there is a way to make this with only one loop. Thanks!