I have an object that looks like this:
var myObject = { a: { b: [{}], c: [{}, {d: 2}], e: 2, f: {} }, g:{}, h:[], i: [null, 2] }
I want to remove null values and and empty objects (array and objects) so that it looks like:
{ a: {c: [ {d: 2} ], e: 2 }, i: [ 2 ] }
The function should remove null values, empty objects and empty arrays. Any elegant way to do it ?