const array = [{
id: "U",
T: "001"
},
{
id: "R",
T: "002"
},
{
id: "U",
T: "003"
},
{
id: "R",
T: "004"
},
{
id: "U",
T: "005"
},
]
Above array can have multiple objects with id: 'R' and i want to ignore all objects that are before id: 'R'.
Expected:
const array = [
{ id: "U",
T: "005"}]
Can someone please help with this