Say I have the following dataset:
const art = {
'fields': [
{title:'Title 1'},
{'text': [
{spaces: '1'}, {link: 'This is a link'}, {mouse: 'Yes'}
]},
{title: 'Title 2'},
{title:'Title 3'},
{'text': [
{spaces: '2'}, {link: 'This is a different link'}, {mouse: 'No'}
]},
]};
I would like to extract a new object(array) from the "spaces" property. In addition to that, I need to to identify those "title" objects that do not have a "spaces" property associated with them with a blank value.
I'd like to end up with something like this:
newArray = ['', '1', '', '', '2']
Is this possible? Forgive me if my terminology isn't great. New at this.