I am working with an array of objects called data
, each object in the array having multiple properties, some of which may have null values.
https://i.sstatic.net/hc5O3.png
My goal is to filter through this array and eliminate any object that contains a property with a null value. Although I've attempted the following code, it hasn't been successful:
const noNull = data.filter((doc) => { return Object.values(doc).some(prop => { if (prop !== null) return doc; } )});
Does anyone have suggestions on how I could achieve this?
Thank you for your help.