I have an Array as shown below
var test =
[
{
"name": "Mike",
"incentives": "23.45",
"id": "1"
},
{
"name": "Larsen",
"incentives": "34.78",
"id": "2"
},
{
"name": "Steve",
"incentives": "26.78",
"id": "3"
}
]
I want to remove a certain Object
I have tried as shown below
var idtoberemoved = 2
test = test.filter((obj) => typeof obj.id = '2');
test.filter((obj) => obj.id === '2');