For example, I want to see if response.objects[0].images[0].url
exists (and isn't null)
What would be the most proper way to verify if the url property exists in the object?
If I just did
if (response.objects[0].images[0].url !== undefined && response.objects[0].images[0].url !== null {
console.log(response.objects[0].images[0].url);
}
But then it can lead to issues if any of the properties before the url
one are themselves undefined or null.
Should I deeply nest and verify if each of the previous properties are either not null and not undefined as well?