I'm looking to extract specific information from a nested object with unknown keys and create a new array with it.
This data is retrieved from the CUPS API, where printer names act as keys.
I want to filter based on conditions like 'printer-state' === 3
.
const data = {
'Expedition': {
'printer-is-shared': false,
'printer-state': 4,
'printer-state-message': '',
'printer-state-reasons': ['none'],
},
'Serverroom': {
'printer-is-shared': false,
'printer-state': 3,
'printer-state-message': '',
'printer-state-reasons': ['none'],
}
}
Thank you!
I attempted using Array.filter() but couldn't quite get it to work as intended.