How do I verify the existence of an object in JavaScript?
The following works:
if (!null) alert(\"GOT HERE\");
But this throws a
The thread was opened quite some time ago. I think in the meanwhile the usage of a ternary operator is the simplest option:
maybeObject ? console.log(maybeObject.id) : ""