I have an array of objects called rate. Within each rate object is a tags property. I would like to combine the tags from all objects into new array such that expected output is:
["TAG_1_2_3_4", "TAG_7_8_9_0", "TAG_4_5_6"]
Is there a simpler/cleaner way than using forEach to loop through and then push to array?
Example:
[
{
"price": "123",
"tags": [
"TAG_1_2_3_4",
"TAG_7_8_9_0"
]
},
{
"price":"456",
"tags":[
"TAG_4_5_6"
]
}
]