I have a question on what's the best way to achieve this, I have an array with 8 objects:
myArray = [ {id: 1, name, xxx, town: Town}, ...]
then I have a second array with another 8 objects of type Town:
townArray = [ {id: 1, name: RngTown}, ... ]
I subscribe to the first array, then I subscribe to the second, and what I want to achieve is a new array that fills the property Town of myArray, with the 8objects in townArray, order doesn't matter, it's just dummy data.
is map() the right way?
and in this example I have 8 objects in the first array, and 8 in the second, so each property Town will have a unique Town from the second array, but what would happen if I only had 6 town object? Can I map all of them to my 8objects, and when they finish after 6 towns, they start from the first town again until all objects in the first array have a town?
thank you