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
{{ message }}
This repository has been archived by the owner on Oct 12, 2022. It is now read-only.
the "true" branch narrows to types which have an optional or required property n, and the "false" branch narrows to types which have an optional or missing property n.
As a typescript beginner this is very confusing to me. Which branch is executed if the type has an optional property n? The text seems to suggest that both branches are executed which can't be the case.
I'm guessing that for optional properties the in operator returns false if the property value is undefined and true otherwise?
Please rephrase this to make it clear.
The text was updated successfully, but these errors were encountered:
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
The
in
operator documentation says the following:As a typescript beginner this is very confusing to me. Which branch is executed if the type has an optional property
n
? The text seems to suggest that both branches are executed which can't be the case.I'm guessing that for optional properties the
in
operator returns false if the property value isundefined
and true otherwise?Please rephrase this to make it clear.
The text was updated successfully, but these errors were encountered: