I have list of objects whom I want to loop through to see for the value of a key, in this I want to remove objects whode id= "null". Below is snippet:
obj: {
after:{
id: null,
name:'test',
address: '63784hgj'
},
before:{
id: 678346,
name:'test',
address: '63784hgj'
},
single:{
id: null,
name:'test',
address: '63784hgj'
},
range:{
id: 65847,
name:'test',
address: '63784hgj'
}
}
I tried some sloppy way of doing this, considering I know the object that has id with null value:
obj.abc.id.destroy;
obj.abc3.id.destroy;
below is the way the object is seen:
is there any way I could remove objects that dont have null values for their id's?
Thx~