2
I have two arrays:
const array1 = ['lorem','ipsum','teste','','hello','','vol']
const array2 = ['lorem','ipsum','teste','array2Tes','','world','vol']
How do I merge the empty parts of the first array with the filled parts of the second array at the same position. At position 3 of the array1 is empty , but in that same position of array2 is filled with 'array2Tes'. E, at position 4 of the array2 is empty, but at that same position in array1 is filled with 'hello'. Would look like this:
const newArray = ['lorem','ipsum','teste','array2Tes','hello','world','vol']
How do I make this mixture?
The two arrays will always be the same size?
– Sam
That. They will always have the msm size.
– RamonCP