I have the following array:
var k = {
a: 67576567,
b: 567657,
c: "some",
d: [
{src:"b", id:1},
{src:"c", id:2},
{src:"d", id:3}
]
};
I'm looking for a way to obtain the following array without using a for:
["b", "c", "d"]
I tried to use the filter function but it always return the entire object:
var filtered = k.d.filter(function(value) {
return value.src;
});
console.log(filtered);
Is there a way to do that?