TypeScript

The official blog of the TypeScript team.

Latest posts

Announcing TypeScript 4.6 Beta
Jan 21, 2022
Post comments count 2
Post likes count 0

Announcing TypeScript 4.6 Beta

Daniel Rosenwasser
Daniel Rosenwasser

Today we are excited to announce the beta release of TypeScript 4.6! To get started using the beta, you can get it through NuGet, or use npm with the following command: You can also get editor support by Here's a quick list of what's new in TypeScript 4.6! Allowing Code in Constructors Before  In JavaScript classes it's mandatory to call  before referring to . TypeScript enforces this as well, though it was a bit too strict in how it ensured this. In TypeScript, it was previously an error to contain any code at the beginning of a constructor if its cont...

Announcing TypeScript 4.5
Nov 17, 2021
Post comments count 3
Post likes count 0

Announcing TypeScript 4.5

Daniel Rosenwasser
Daniel Rosenwasser

Today we're excited to announce the release of TypeScript 4.5! If you're not yet familiar with TypeScript, it's a language that builds on JavaScript by adding statically checked types. When you use static types, you can run the TypeScript compiler to check for bugs like typos and mismatches in the shapes of your data, and get handy suggestions. These types don't change your program, and you can remove them to leave you with clean, readable JavaScript. Going beyond catching bugs in your code, TypeScript also assists you in writing code because types can power useful tooling like auto-complete, go-to-definition,...

Announcing TypeScript 4.5 RC
Nov 2, 2021
Post comments count 1
Post likes count 0

Announcing TypeScript 4.5 RC

Daniel Rosenwasser
Daniel Rosenwasser

Today we're excited to announce our Release Candidate (RC) of TypeScript 4.5! Between now and the stable release of TypeScript 4.5, we expect no further changes apart from critical bug fixes. To get started using the RC, you can get it through NuGet, or use npm with the following command: You can also get editor support by If you've already read our beta blog post, you can read up on what's changed since. Some major highlights of TypeScript 4.5 are: What's New Since the Beta? Since our beta release post, 4.5 has gone through a...

Type | Treat – Wrap-up
Oct 30, 2021
Post comments count 0
Post likes count 1

Type | Treat – Wrap-up

Orta Therox
Orta Therox

Type | Treat Challenge Wrap-up That's all the challenges done! If you missed any of the challenges they're all available in the Playground here. Let's talk through the final answers to day 5's challenges. Yesterday's Solution Beginner/Learner Challenge In this challenge we were working with an existing object literal which had been 'd. The goal was to use and to extract interesting sets of strings from the object. The first being the keys in the object: Ideally, you might have noticed the 'key of' in the comment, which could have led you to , from there you needed to re-use to extract the type from . Th...

Type | Treat – Day 5
Oct 29, 2021
Post comments count 1
Post likes count 0

Type | Treat – Day 5

Orta Therox
Orta Therox

Type | Treat Challenge 5 Welcome to the fifth, and last, challenge! These challenges are a series of blog posts which have 2 code challenges in, one for beginners and one for intermediate TypeScript programmers. We're on day five, which means going over the answers from yesterday and have 2 new challenges. Yesterday's Solution Beginner/Learner Challenge This challenge aimed to be generics 101, first introducing the concept of making your function pass a type from the function to the argument: The acted as hint clue about where to look, and this example is almost the first code sample on the Generics ...

Type | Treat 2021 – Day 4
Oct 28, 2021
Post comments count 2
Post likes count 0

Type | Treat 2021 – Day 4

Orta Therox
Orta Therox

Type | Treat Challenge 4 Welcome to the fourth challenge! These challenges are a series of blog posts which have 2 code challenges in, one for beginners and one for intermediate TypeScript programmers. We're on day four, which means going over the answers from yesterday and have 2 new challenges. Yesterday's Solution Beginner/Learner Challenge I wonder if we over-indexed on the difficulty here, and we're interested if you dropped off somewhere through this task because we had less submissions than usual for this challenge. The goal was to have you build out a template string literal type which accounted for ...

Type | Treat 2021 – Day 3
Oct 27, 2021
Post comments count 2
Post likes count 0

Type | Treat 2021 – Day 3

Orta Therox
Orta Therox

Type | Treat Challenge 3 Welcome to the third challenge! These challenges are a series of blog posts which have 2 code challenges in, one for beginners and one for intermediate TypeScript programmers. We're on day three, which means going over the answers from yesterday and have 2 new challenges. Yesterday's Solution Beginner/Learner Challenge There is many ways to decide how to type existing data, you could use literal types when you're sure of the exact formats - or be more liberal and use when you expect a variety. We opted for literals, but using is totally cool too. The second part of the chall...

Type | Treat 2021 – Day 2
Oct 26, 2021
Post comments count 0
Post likes count 0

Type | Treat 2021 – Day 2

Orta Therox
Orta Therox

Type | Treat Challenge 2 Welcome to the second challenge! These challenges are a series of blog posts which have 2 code challenges in, one for beginners and one for intermediate TypeScript programmers. We're on day two, which means going over the answers from yesterday and showcasing 2 new challenges. Yesterday's Solution Beginner/Learner Challenge The first part of the solution for this challenge used to trigger "Literal Inference" - basically telling TypeScript "Don't convert the array to but consider it a constant set of string literals. This meant that stopped returning and started returning . ...

Type | Treat 2021 – Day 1
Oct 25, 2021
Post comments count 1
Post likes count 0

Type | Treat 2021 – Day 1

Orta Therox
Orta Therox

Spooky TypeScript challenges for beginner and intermediate programmers, day 1.