I am trying to convert one arraylist to another by modifying one of the objects inside
let array1 = [
{
name: "test",
address: "testaddress",
state: {
2022: {
January: { month_state: "pending" },
},
},
},
{
name: "test2",
address: "testaddress2",
state: {
2022: {
January: { month_state: "pending" },
},
},
},
];
And I want to convert into this, which is the correct way? Thanks.
let array2 = [
{
name: "test",
address: "testaddress",
2022: {
January: { month_state: "pending" },
},
},
{
name: "test2",
address: "testaddress2",
2022: {
January: { month_state: "pending" },
},
},
];