🔰short-circuiting
JS ⟩ statement ⟩ expression ⟩ operator ⟩ term ⟩ short-circuiting
a && b // b may not be evaluated
a ?? b // (same)
condition ? a : b // only one of a and b is evaluated
obj ?. prop // prop may not be evaluated
f ?. (args) // args expressions may not be evaluated
logical operator (&&, ||) - a && b, a || b
nullish coalescing (??) - a ?? b
conditional operator (?:) - condition ? a : b
optional chaining (?., ?.[]) - obj ?. prop, obj ?. [prop]
optional invocation ?.() - f ?. (args)
Last updated
Was this helpful?