TypeScript 4.6 loosens up

TypeScript 4.6, the next iteration of Microsoft’s strongly typed superset of JavaScript, has moved to a beta release, with enhancements for coding and control flow analysis. The beta was announced on January 21.One improvement relaxes coding restrictions by allowing code in constructors before super(). In JavaScript classes, it is mandatory to call super() prior to referring to this. TypeScript also enforced this but was a bit too strict, according to a bulletin on TypeScript 4.6. It had been an error to contain any code at the beginning of a constructor if its containing class had property initializers. This made it “cheap” to check that super() was called before this was referenced, but resulted in valid code being rejected. TypeScript 4.6 relaxes this check. It also permits other code to run before super() while ensuring that super() occurs at the top level before references to this.To read this article in full, please click here

Nov 30, -0001 - 00:00
 0
TypeScript 4.6 loosens up
Techatty All-in-1 Publishing
Techatty All-in-1 Publishing

TypeScript 4.6, the next iteration of Microsoft’s strongly typed superset of JavaScript, has moved to a beta release, with enhancements for coding and control flow analysis. The beta was announced on January 21.

One improvement relaxes coding restrictions by allowing code in constructors before super(). In JavaScript classes, it is mandatory to call super() prior to referring to this. TypeScript also enforced this but was a bit too strict, according to a bulletin on TypeScript 4.6. It had been an error to contain any code at the beginning of a constructor if its containing class had property initializers. This made it “cheap” to check that super() was called before this was referenced, but resulted in valid code being rejected. TypeScript 4.6 relaxes this check. It also permits other code to run before super() while ensuring that super() occurs at the top level before references to this.

To read this article in full, please click here

Techatty Connecting the world of tech differently! Read. Write. Learn. Thrive. Make an informed decision without distractions. We are building tech media and publication networks to connect YOU and everyone to reliable information, opportunities, and resources to achieve greater success.