I have an array like this one:
[{
'0': [7]
}, {
references: [0]
}, {
'1': [8]
}, {
references: [9]
}, {
'2': [20]
}, {
references: [50]
}]
I want to remove all objects containing the reference key. Any suggestions?
not pop or splice, filter
var a = [
{ 0:[7]},
{ references:[0]},
{ 1:[8]},
{references:[9]},
{ 2:[20]},
{ references:[50]}
];
var filteredA = a.filter(function(item){ return !('references' in item) });