I have a JSON obj, after some operations (like delete some pieces), I print it and everything looks good except that I have some null values. How do I remove th
null
We can use JSON.stringify and JSON.parse together to recursively remove blank attributes from an object.
jsObject = JSON.parse(JSON.stringify(jsObject), (key, value) => { if (value == null || value == '' || value == [] || value == {}) return undefined; return value; });