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 was archived by the owner on Jan 25, 2022. It is now read-only.
Technically the semantics are enforced by introducing a special Reference, called Nil, which is propagated without further evaluation through left-hand side expressions (property accesses, method calls, etc.), and which dereferences to undefined (or to /dev/null in write context).
In this example what would be the ouput if b is null?
a?.b()
I expect this to throw but as far as I understand Nil will be propagated and b will not be called.
a?.b?.()
In the latter case we're using the optional chaining syntax so that the function call b() is conditional
What is the difference between the two examples?
What do you think about that?