I have an object that looks like this:
const data = {
"supportPaneltext": [{
"brand": "BMW",
"paragraphList": [{
"rowList": [
"Europe, Middle East, Africa, Asia, Pacific"
]
}]
},
{
"brand": "Mercedez",
"paragraphList": [{
"rowList": [
"Europe, Middle East, Africa, Asia, Pacific"
]
}]
}]
}
I want to filter out the "brand" value to an array. The result would look like: ["BMW", Mercedez"]
I have tried to filter out by:
Object.values(data).filter((item) => item.brand)
Without luck, What do I miss?