Thursday, 23 June, 2022 UTC


TypeScript 4.8, a planned upgrade to Microsoft’s popular strongly typed JavaScript variant, is set to add correctness and consistency improvements and file-watching fixes to the language.
Published as a beta release June 21, TypeScript 4.8 is due for general availability on August 23. With the beta, a series of improvements to consistency and correctness is introduced under strictNullChecks. These changes affect how intersection and union types function and are leveraged in how TypeScript narrows types. In one example, unknown is close in spirit to the union type {} | null | undefined because it accepts null, undefined, and any other type. TypeScript now recognizes this and allows assignments from unknown to {} | null | undefined. Changes in TypeScript 4.8 allow for sensible improvements in control flow and type narrowing, Microsoft said. Generic values also get narrowed.
To read this article in full, please click here