[{foo : 'blar', baz: 'hey'}, {x : 'fum', baz: 'another hey'},{x : 'ack', baz: 'yet another hey'} ]
.map(obj => {
for (var prop in obj){
if (prop !== 'baz'){
return {prop : obj[prop]};
}
}
})
I'd like to get an array which contains these objects sans thebaz
property in each.
I am getting this right now....
[
{prop: "blar"},
{prop: "fum"},
{prop: "ack"}
]
Should be:
[
{foo: "blar"},
{x: "fum"},
{x: "ack"}
]