I have an array of objects like this:
{
pksites: number;
rooms: Room[];
}
And I'm trying to add the rooms to that array, here is what i do:
arrayOfObjects.forEach((s) => {
s.rooms.push(...s.rooms, //new object from here{
pkrooms: 1,
roomname: "Test room",
})
})
and the error i get is
TypeError: Cannot add property 0, object is not extensible at Array.push (<anonymous>)
what can I do?
arrayOfObjectscontain?