How to replace object value array with another array in angular?

Here is the var1 with origin address:

const var1 = {
      "name": "Foo",
      "address": [
        {"street": "stree1", "city": "city1", "state":"state1"},
        {"street": "stree2", "city": "city2", "state":"state2"}
      ]
}

I would like to replace with new array from HTTP response: ["15345646", "1354653"] and expected result:

{
      "name": "Foo",
      "address": ["15345646", "1354653"]
}

I tried to use var1.address = ["15345646", "1354653"], but I got the error about Type 'addressCreateResponse' is missing the following properties from type '{ street: string, city: string, state:string}': "street", "city", "state"

How to achieve this in angular?

Thank you!

1 answer