I would like to know a quick and clean way to check if objects with just __ob__
or __proto__
properties are empty. Now I have to "guess" a value inside my object and null check that instead of the object itself. Example:
const myObject = objectFromDb.innerValue ? objectFromDb : mockObject;
I would love to write this instead:
const myObject = objectFromDb || mockObject;
but it will return objectFromDb even if the values have not yet been retrieved. I'm fine with using a ternary statement instead if the ||
one, but I'm not happy with having to null-check an inner object. I'm sure there has to be a better way of doing this.