The TypeScript datatyping support not only applies to simple variables, it also supports you when doing clever things with functions. Specifically, TypeScript ensures you create reliable code when ...
Microsoft shipped the latest iteration of its type-infused superset of JavaScript, TypeScript 5.5, introducing inferred type predicates, control flow narrowing, JSDoc @import and other enhancements.