0

How can i clean empty nested objects value like this? I need to return only the dRannge since it has value

const obj = {
 dRange: {daysBack: 10},
 tRange: {fromTime: {dateTime: ""}}
}
eladr
  • 343
  • 1
  • 4
  • 18
  • You mean you want to remove the tRange property from this object? – ADyson Feb 03 '22 at 10:18
  • `delete obj.tRange` will remove the property. Now you will need to come up with the logic to find the empty values. – evolutionxbox Feb 03 '22 at 10:18
  • Yes. But assume i have similar large object with many properties and i need to check and iterate all object and remove empty values – eladr Feb 03 '22 at 10:20

0 Answers0