The TypeScript 4.0 Beta Is Here

The TypeScript 4.0 Beta Is Here

In my previous article, I talked about the new features in TypeScript version 3.9. Today, I will be peeking into the TypeScript 4.0 beta version, which was released on June 25, 2020.

In my previous article, I talked about the new features in TypeScript version 3.9. Today, I will be peeking into the TypeScript 4.0 beta version, which was released on June 25, 2020. With this beta release, we take our first set to TypeScript4.0. Although this brings a new major version, there are no 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.

startup programming javascript front-end-development typescript

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

How to Master the Front-End Development

Learn how to focus your skills to become a master at front-end development. How to Master the Front-End Development. A few years back doing front-end work, especially on the web, was rather simple compared to the back-end where all the app logic used to reside. Nowadays, that has changed. Front-end development has evolved thanks to powerful frameworks and libraries supported by the evolution of the browsers and their respective APIs.

Top 6 Productivity Tools for Front-end Developers

Today I wanted to share with you the tools I daily use to increase my productivity as a front-end developer. 6 tools to increase your productivity as a Front-end developer.

Top 19 Front-End Web Development Tools to Consider in 2020

In this post, we are putting curated list of top tools with key features and download links "Top 19 Front End Web Development Tools to Consider in 2020"

Setting Up Pop!_OS for Front End Development

If you’ve heard all the chatter lately about Pop!_OS and have been wanting to try it out, here’s a good guide to setting up a front end…

The Many Flavours of Micro Front Ends

3 ways to implement micro front ends in your next application