Hi,
I have an external API request that has a somewhat changing schema somewhere in the nested elements.
That means potentially a key does not exist.
I am trying to create an IF statement to check whether the key exists. It's not null, or empty. It's really undefined.
But obviously I get the error from the if statement that the key that I am trying to look for does not exist.
How can I make sure that I can check whether the key exists before I proceed.
(if it exists it holds an array of objects that I want to loop through, so the whole rest of the function depends on it)
Conditional IF/THEN with potentially non existing key
8 replies