I have the following json object that runs with:
obj = { '19': { id: '19', price: 5.55},
'20': { id: '20', price: 10.00} }
$.each(obj, function(index, value){
if(value.price < 5)
{
delete obj[index];
}
});
I just want to remove an element from an object under certain conditions. In this case, if the price is less than 5.
I tried to delete, but does nothing.
source
share