Nowadays, it’s difficult to imagine a serious JavaScript-based application without a TypeScript superset. Interfaces, tuples, generics, and other features are well-known among TypeScript developers. While some advanced constructs may require a learning curve, they can significantly bolster your type safety. This article aims to introduce you to some of these advanced features.
Type Guards
Type guards help us to get info about a type within a conditional block. There are a few simple ways to check the type using in
, typeof
, instanceof
operators, or using equality comparison (===).