I have a dynamic array (chat messages), like
{
id:1,
message: bla-bla
},
{
id:2,
message: bla-bla
},
{
id:1,
message: bla-bla
},
{
id:1,
message: bla-bla
},
{
id:3,
message: bla-bla
},
{
id:4,
message: bla-bla
}
How to leave in array only items with id:1, or remove all items where id not 1