I have this object where addon_sizes
keys are dynamic i.e "1","2", "3", "4"
:
const sizes = {"addon_sizes": {"1": ["a", "b"],"2": ["c"],"3": null,"4": [] }}
I need to remove all key/value pairs in this object where the value is null/undefined/empty array.
So the keys "3" and "4" should be removed from the list.
So far what i have tried is:
const newObj = R.reject(R.anyPass([R.isEmpty, R.isNil]))(sizes.addon_sizes);
But this doesn't remove the null or empty values.