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
This does not encourage neither more nor less efficient coding. In the example you quotes, it's true that there is one more nullish check but, in the case of a non-nullish node, there is one less variable lookup.
In some other examples, such as if (element.node) element.node.decorators = null;, using element.node?.decorators = null avoids reading element.node twice.
One of the examples in this gist is:
could be rewritten as
This is performing the same test twice at runtime.
The original was more efficient.
The text was updated successfully, but these errors were encountered: