Here is the structure I am working with:
{
"subs": [
{
"status": "1",
"run_settings": null,
"ward": "/asda/asd/ada"
"value": null,
"name": null
},
{
"status": "0",
"run_settings": null,
"ward": "/asda/asd/txa"
"value": null,
"name": abc
}
],
"name": "step"
}
I am trying to verify if any field in one of the indexes within the subs
array is null
.
I attempted the following code snippet:
this.data.subs.map(sub => Object.values(sub).every(x => (x !== null && x !== 'undefined')))
However, this results in [false,false]
. While I can add another loop to check for any false
values, it seems like there might be a simpler solution. Any suggestions on a more effective way to determine if any field in one of the indexes within the array subs
is null
?