Microsoft TypeScript 3.7: Programming language beta lands with all these features

Microsoft improves TypeScript, its programming language for developers building big JavaScript applications.
Written by Liam Tung, Contributing Writer

Microsoft has released TypeScript version 3.7 beta, its popular JavaScript superset, with all the features it expects to release in the final build, scheduled for availability in early November. 

The mission between now and November is to fix bugs and improve performance and stability. However, JavaScript developers can now test all the new features Microsoft has brought to TypeScript, which has quickly become one of the most popular programming languages to use

The language adds 'optional static types' to JavaScript, allowing the TypeScript compiler to do type-checking to catch common errors in programs. 

SEE: Six in-demand programming languages: Getting started (free PDF)    

It's also got broad editor support, including Visual Studio Code, Vim, and Emacs. 

Microsoft announced TypeScript in 2012 to make it easier for developers to build large-scale JavaScript applications.  

The main addition to TypeScript 3.7 is 'optional chaining', which offers developers a faster way to handle errors when encountering 'null' and 'undefined' 'falsy' values in JavaScript.

"So what is optional chaining? Well at its core, optional chaining lets us write code where we can immediately stop running some expressions if we run into a null or undefined. The star of the show in optional chaining is the new ?. operator for optional property accesses," explains Daniel Rosenwasser, a program manager with Microsoft's TypeScript team

Microsoft has used its involvement in Ecma International, Technical Committee 39 (TC39) to bring optional changing to ECMAScript, the specification created to standardize JavaScript. The scripting language was developed by Brendan Eich, co-founder of Firefox maker Mozilla, during his time at Netscape. 

The addition of a question mark prepending the operator brings to TypeScript similar operators available in C#, Apple's Swift, Android-aligned Kotlin, Dart, Ruby, and Groovy. 

SEE: Microsoft to Linux developers: We want your help to bring Edge browser to Linux

Linked to optional chaining in TypeScript is another upcoming ECMAScript feature called 'nullish coalescing'

"You can think of this feature – the ?? operator – as a way to 'fall back' to a default value when dealing with null or undefined," writes Rosenwasser. 

And Microsoft is adding its answer to 'assertion functions', which throw an error when something unexpected happens in JavaScript. But in TypeScript they caused inefficiencies for developers. TypeScript 3.7 introduces 'assertion signatures' to address this issue.  

Rosenwasser also lists a number of breaking changes in version 3.7 that developers should be aware of. Ahead of the final release of TypeScript 3.7 in early November, Microsoft will offer a release candidate. 

More on programming languages and Microsoft's TypeScript

Editorial standards