Thursday, 17 November, 2022 UTC


Microsoft’s TypeScript 4.9, a planned upgrade to the popular, strongly typed language that builds on JavaScript, is now available as a production release. The update features a satisfies operator that can catch errors.
With satisfies, developers can validate that the type of an expression matches some type, without changing the resulting type of the expression. This operator can be used to catch possible errors, such as ensuring that an object has all the keys of some type, but no more than that.
Also in TypeScript 4.9, the in operator has been made more powerful when narrowing types that do not list the property. Instead of leaving them as is, the language will intersect their types with Record<”property-key-being-checked”, unknown>.
To read this article in full, please click here