I am a newbie on Google App Scripts. So far so good. Trying to do some of the stuff I used to do in an MsAccess DB. I think I have hit a bit of a problem, which could be related to the sheer amount of data I have. To illustrate my problem:
I have two arrays:
**Array1**
ID || Name <br>
0001 || Peter<br>
0005 || Arthur<br>
0008 || Gloria<br>
0010 || Martin<br>
0014 || Jess <br>
**Array2**
ID || Age <br>
0001 || 23<br>
0002 || 18<br>
0005 || 24<br>
0010 || 7<br>
As you can imagine, I want to produce something like:
**Array3**
ID || Name || Age <br>
0001 || Peter || 23<br>
0005 || Arthur|| 24 <br>
0010 || Martin || 7<br>
I have used the most simple code I can think of to the 'join':
for (var a=0; a<array1.length; a++) {
for (var b=0; b<array2.length; b++) {
if (array1[a][0] == array2[b][0]) {
array3.push([array1[a][0],array1[a][1],array2[b][1]); break;
}
}
}
Problem is: array1 is 70,000 entries long, and array2 is about 10,000 entries long, meaning the code runs out of time.
What would you guys do?