Better Programming

Advice for programmers.

Follow publication

Member-only story

7 Must-Know Typescript Transpiled Features

Jose Granja
Better Programming
Published in
6 min readJan 28, 2021
Image of partially blurred code.
Photo by Kevin Ku on Unsplash

Typescript is a programming language developed and maintained by Microsoft. It is a superset of Javascript and adds typing to the language. It has cool features like Type Guards, Mapped Types, and Union Types. It’s great for working with large codebases as its typing provides some more comprehensive contracts from your interfaces.

Typescript does transpile into Javascript. In your tsconfig configuration file, you can specify which is the target language you want it transpiled to. That means you can already work with cutting edge ECMAScript features out of the box.

Let’s look at the Top 7 features that Typescript can transpile.

1. Optional Chaining

“The optional chaining operator (?.) permits reading the value of a property located deep within a chain of connected objects without having to expressly validate that each reference in the chain is valid. The ?. operator functions similarly to the . chaining operator, except that instead of causing an error if a reference is nullish (null or undefined), the expression short-circuits with a return value of undefined. When used with function calls, it returnsundefined if the given function does not exist.”

— MDN

ECMAScript 2020 brought this awesome feature. It was available earlier on the Typescript language and it’s a handy one.

Optional Properties are as follows:

Optional Methods are as follows:

Stack optional evaluators include the following:

Create an account to read the full story.

The author made this story available to Medium members only.
If you’re new to Medium, create a new account to read this story on us.

Or, continue in mobile web

Already have an account? Sign in

Jose Granja
Jose Granja

Written by Jose Granja

Top Writer @Medium | 1M+ Views | Lead FE @Lingoda | I write weekly about web-development topics 📰 Support me at https://dioxmio.medium.com/membership 🙇

Responses (1)