I am trying to delete a single object from the below object of arrays. I have tried with slice but sometimes it doesn’t work. That’s why I want to try different methods.
{
id: "6252de4b27082fd83b94e3f4";
options: [
{ title: "extra Tomato", price: 2 },
{ title: "ketchup", price: 1 },
{ title: "medium", price: 3 },
];
price: 5.1;
quantity: 1;
title: "Carroll Montgomery";
}
suppose I want to delete medium
object my expected output would be:
{
id: "6252de4b27082fd83b94e3f4";
options: [
{ title: "extra Tomato", price: 2 },
{ title: "ketchup", price: 1 },
];
price: 5.1;
quantity: 1;
title: "Carroll Montgomery";
}