vendredi 17 avril 2015

Combining Array with Array of Arrays

I have the following arrays of arrays w a little overlapping of elements:



arr1 = [[a,b], [c,d], [e,f], [g, h]]
arr2 = [[a, 1, 2, 3], [c, 4, 5, 6], [e, 7, 8, 9], [g, 10, 11, 12]]


How can I get to



arr1 = [[a, b, 1, 2, 3], [c, d, 4, 5, 6], [e, f, 7, 8, 9], [g, h, 10, 11, 12]]


I have tried looping this and using splice, split, concat but am having some issue with the logic. Thanks in advance.


Aucun commentaire:

Enregistrer un commentaire