var objs = [
{labels: ["label1", "label2"]},
{labels: ["label1", "label3"]},
{labels: ["label2", "label4"]}
]
i am trying to extract this ["label1", "label2", "label3", "label4"]
labels = this.get('objs').map(function(obj) {
return obj.labels.map(function(label) {
return label;
});
});
console.log(labels);
But the above code printed [["label1", "label2"], ["label1", "label3"], ["label2", "label4"]]
Can someone help me with this?