There was a moment when I recall stumbling upon a code snippet that utilized a javascript library, possibly lodash, to perform a comprehensive check for the existence of a certain element.
For instance:
someLib.isDefined(anObject.aNestedObject.anotherNestedObject);
This function would return true if anotherNestedObject exists, but it would return false without causing an error if anObject or aNestedObject were not defined.
Is this just a figment of my imagination, or does a popular function capable of this task actually exist?