You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have three checks in a "&&" chain. The order of the first two checks seems to have an effect on whether I can perform the third check. Am I missing something?
functionf1(x: unknown): any{returnx&&typeofx==='object'&&x.hasOwnProperty('x');// ^ TS reports error: Object is possibly 'null'}functionf2(x: unknown): any{returntypeofx==='object'&&x&&x.hasOwnProperty('x');// no error}