Ts Playground 37 __full__ -
const input = 0; const value = input ?? 10; // Result is 0. Perfect!
name = 'John Doe'; console.log(name ?? 'Unknown'); // "John Doe" ts playground 37
The optional chaining operator ( ?. ) is a welcome addition to TypeScript. In the Playground, you can experiment with this feature using the following example: const input = 0; const value = input