I am trying to extract the filterPillvalue and store it in an array, where the output should look like this:
mode = ['anyValue','Repsonding','Unresponsive']
My approach is as follows:
this.items = [
{
filterPillValue: 'anyValue',
id: 'all-systems',
label: 'All systems'
},
{
filterPillValue: 'Responding',
id: 'responding',
label: 'Responding systems'
},
{
filterPillValue: 'Unresponsive',
id: 'unresponsive',
label: 'Unresponsive systems'
}
];
However, the following code snippet does not work in this scenario:
mode = this.items.filter(x=>x.filterPillValue);