TypeScript 3.7 beta debuts with optional chaining
The next version of TypeScript, Microsoft’s typed superset of JavaScript, will include optional chaining, an ECMAScript feature that allows developers to stop running expressions if they encounter a null
or undefined
value.
A beta version of TypeScript 3.7 was released October 1, with general availability planned for early November. A release candidate is due before then.
Optional chaining uses a new ?.
operator for optional property accesses. Also included are two other operations: optional element access, for accessing non-identifier properties such as numbers and arbitrary strings, and optional call, for conditionally calling expressions if they are not null
or undefined
.