Skip to content

A demo repo with ES2020 features using TypeScript

Notifications You must be signed in to change notification settings

jwulf/es2020-ts

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ES2020 Features using TypeScript

These are new ES2020 features that you can use now with TypeScript 3.8.

  • Git clone this repo
  • npm i

Optional chaining

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

Nullish coalescing

Dealing with default values when falsy values are valid.

Code: src/nullish-coalescing.ts.

Run:

npm run nullish

Promise.allSettled

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

About

A demo repo with ES2020 features using TypeScript

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published