I have my empty Array
locations = []
and I have another Array with locations and city's
Data = [
{ location: "01" , city: "01"},
{ location: "01" , city: "02"},
{ location: "03" , city: "03"},
{ location: "04" , city: "04"},
{ location: "01" , city: "01"},
{ location: "01" , city: "01"}
]
how can I loop through array Data[] and add the objects in locations[] without repeating it like first objects and last two objects
locations = [
{ location: "01" , city: "01"},
{ location: "01" , city: "02"},
{ location: "02" , city: "02"},
{ location: "03" , city: "03"},
{ location: "04" , city: "04"}
]