What’s New in TypeScript 4.0

What’s New in TypeScript 4.0

Let’s explore the latest version of TypeScript. So let’s see what’s new in TypeScript 4.0: Labeled Tuple Elements; Class Property Inference From Constructors; Short-Circuiting Assignment Operators; ‘unknown’ on ‘catch’ Clause Bindings; Speed Improvements in Build Mode With ‘--noEmitOnError’; ‘--incremental’ With ‘--noEmit’; Editor Improvements;

Let’s explore the latest version of TypeScript

TypeScript has announced its latest version of TypeScript today (20th of August, 2020) and I thought of doing a quick recap on its features and changes. With this release, TypeScript brings the final, stable version of their latest update. Although this brings a new major version, there are no more substantially large, breaking changes than usual. So let’s see what’s new in this version.

Labeled Tuple Elements

This language feature changes the way a tuple is defined. Previously, tuples were defined as follows:

function tuple(...args: [string, number]): void {
    // ...
}

In the above example, there are no parameter names for the first and second elements. While these have no impact on type-checking, the lack of labels on tuple positions can make them harder to use — harder to communicate our intent.

As a solution to this, TypeScrip 4.0 brings tuples with labels.

type Segment = [length: number, count: number];

But if you are going to label an element, you must label all the elements in the tuple. If not, you will receive an error.

type Segment = [first: string, number];
//                         ~~~~~~
// error! Tuple members must all have names or all not have names.

javascript typescript web-development developer

Bootstrap 5 Complete Course with Examples

Bootstrap 5 Tutorial - Bootstrap 5 Crash Course for Beginners

Nest.JS Tutorial for Beginners

Hello Vue 3: A First Look at Vue 3 and the Composition API

Building a simple Applications with Vue 3

Deno Crash Course: Explore Deno and Create a full REST API with Deno

How to Build a Real-time Chat App with Deno and WebSockets

Convert HTML to Markdown Online

HTML entity encoder decoder Online

TypeScript Tutorial For JavaScript Developers - TypeScript Basics

TypeScript Tutorial For JavaScript Developers - TypeScript Basics. I will show you guys 4 example of JavaScript code, and how to convert it to TypeScript. This is a typescript beginners tutorial.

Why Web Development is Important for your Business

With the rapid development in technology, the old ways to do business have changed completely. A lot more advanced and developed ways are ...

Important Reasons to Hire a Professional Web Development Company

    You name the business and I will tell you how web development can help you promote your business. If it is a startup or you seeking some...

What is TypeScript? Why TypeScript? and Why Not TypeScript?

TypeScript extends JavaScript by adding Types. There are many great reasons to switch to TypeScript. Especially if your team uses JavaScript. There are some reasons to not use TypeScript as there are with any language or framework.

Web Design and Development Services

Get Best out from Web Design and Development Services from Vinew Technologies,We have a dedicated team of experienced and knowledgeable web developers, designers and testers. Therefore, we have proficiency in analyzing, developing and designing the necessity of intricate Website Development projects.