These are new ES2020 features that you can use now with TypeScript 3.8.
- Git clone this repo
npm i
Dealing with properties of objects that may be undefined.
Code: src/optional-chaining.ts.
See: Implementing a maybe pattern using a TypeScript type guard
Run:
npm run optional
Dealing with default values when falsy values are valid.
Code: src/nullish-coalescing.ts.
Run:
npm run nullish
Dealing with an array of tasks that may succeed or fail.
Code: src/promise-allSettled.ts.
See: Handling failure and success in an array of asynchronous tasks
Run:
npm run promise