Microsoft releases TypeScript 4.6 with a score of new features
The latest iteration of the programming language brings never-before-seen features and lots of improvements to make developers' lives easier


Microsoft has released the latest version of TypeScript, version 4.6, which brings with it an array of features including some that weren’t included in the beta or release candidate (RC) versions.
Among these is the ability for developers to narrow types based on discriminate properties, something that would throw an error in previous versions of TypeScript.
Microsoft said it comes down to each developer’s preference and how they like to destructure objects into properties.
“When destructuring individual properties into a const declaration, or when destructuring a parameter into variables that are never assigned to, TypeScript will check for if the destructured type is a discriminated union,” said Daniel Rosenwasser, senior program manager of TypeScript at Microsoft. “If it is, TypeScript can now narrow the types of variables depending on checks of other variables.”
Another of the never-before-seen features in TypeScript 4.6 is the support for es2022 in TypeScript’s --target option. It means features like class fields now have a stable output target where they can be preserved.
It also means more recently added TypeScript functionality like the at() method on arrays, Object.hasOwn, or the ‘cause’ option on a new Error can be used with the new --target setting or with --lib es2022.
A feature that was present in the previous RC release but went undocumented was the suggestions for mismatched JSDoc parameter names. Developers can document parameters using an @param tag but when these fall out of date TypeScript editors will now provide suggestions for when parameter names don’t match between a function and its JSDoc comment.
Get the ITPro daily newsletter
Sign up today and you will receive a free copy of our Future Focus 2025 report - the leading guidance on AI, cybersecurity and other IT challenges as per 700+ senior executives
One change from the beta that made it to the current release is the removal of unnecessary arguments when programming in --jsx react-jsx mode. When compiling certain code, JavaScript would produce code containing a ‘void 0’ argument that simply wasn’t necessary. Overall bundle sizes can be reduced as a result of the argument’s removal, said Rosenwasser.
Further code improvements have been made to classes; developers will now be able to write their constructor’s code before declaring super().
Classes made JavaScript, a language on which TypeScript builds, require the developer to call super() before referring to ‘this’. The rule used to apply to TypeScript too but Rosenwasser said the langauge was too strict in how it enforced the rule - it was a “cheap” implementation that rejected a lot of valid code.
There are a host of other changes brought to TypeScript including, but not limited to, an expansion of binding errors in JavaScript files. The full release notes can be found on Microsoft’s TypeScript developer blog.

Connor Jones has been at the forefront of global cyber security news coverage for the past few years, breaking developments on major stories such as LockBit’s ransomware attack on Royal Mail International, and many others. He has also made sporadic appearances on the ITPro Podcast discussing topics from home desk setups all the way to hacking systems using prosthetic limbs. He has a master’s degree in Magazine Journalism from the University of Sheffield, and has previously written for the likes of Red Bull Esports and UNILAD tech during his career that started in 2015.
-
Oracle Java pricing concerns could spark a developer exodus
News Oracle Java users have raised concerns over pricing, with many considering switching to open source options.
By Solomon Klappholz
-
Python just brushed past JavaScript to become the most popular programming language on GitHub – and a key factor is that AI developers love it
News The meteoric rise of Python shows no sign of stopping
By Nicole Kobie
-
JupyterLab review: A powerful tool for documenting your data science journey
Reviews Literate programming toolkit takes dynamic code documents to new heights
By Danny Bradbury
-
Microsoft continues its Rust mission with new kernel features
News The latest critical feature comes as a "small trial" to select Windows Insiders
By Connor Jones
-
Report: Regulatory and monetary incentives needed to adopt safer programming languages
News Companies have been urged to create plans on how they intend to get rid of memory-unsafe code in their products
By Zach Marzouk
-
Microsoft Azure CTO hails 'most loved' Rust as the successor to C and C++
News Rust is a newer programming language that developers enjoy using and learning, and it's being adopted far across the industry, too
By Connor Jones
-
Programming with Python: Time to upgrade to fancy ANSI
Opinion Wordle inspires Dick to reinvent his 1980s ASCII toolkit for the 2020s, but this time he doubles down with ANSI
By Dick Pountain
-
The best Python test frameworks
Best Make your Python code shine with these testing tools
By Danny Bradbury