Saturday, 11 May 2019

My code tries to access object's property ONLY IF the object is defined, but still throws error that it's undefined.

if (typeof matches.get(matchId) !== 'undefined') { ... if (matches.get(matchId).gettingReady) { ... It crashes saying it can't read property 'gettingReady' of undefined. But, clearly, I have forbidden the code from even trying to read the property if the object is undefined. So what is going on?

Submitted May 12, 2019 at 12:34AM by MyrsVonNiem

No comments:

Post a Comment