When attempting to combine two arrays, the result looks like the image linked below:
https://i.sstatic.net/3FWMZ.png
I want the merged array to resemble the following example:
{0: {…}, storedArr: Array(2)}
0:
address: "ifanio de los Santos Ave, Mandaluyong, 1550 Metro Manila, Philippines"
addressNick: "test1"
latitude: 14.5724682
longitude: 121.0470239
remarks: "No.12"
1:
address: "ifanio de los Santos Ave, Mandaluyong, 1550 Metro Manila, Philippines"
latitude: 14.5724682
longitude: 121.0470239
remarks: "No.12"
__proto__: Object
length: 2
__proto__: Array(2)
__proto__: Obj
Please see the code snippet below for reference:
this.storage.get('storedAdd').then((addrr)=>{
let storedArr = [];
console.log(val)
storedArr.push({
address: val.address[0],
addressNick: val.addressNickName,
remarks: val.remarks,
latitude: val.latitude,
longitude: val.longitude
});
console.log(storedArr)
console.log(addrr)
this.storage.set('storedAdd', {...storedArr,...addrr});
console.log({storedArr,...addrr})
const datatransf = {...storedArr,...addrr}
console.log(datatransf)
this.packageAdd$.next(datatransf);
})