Filtering arrays in TypeScript with correct types
This article explains how to filter arrays in TypeScript while maintaining correct types. It demonstrates how to create a type guard to ensure that the filtered array only contains the desired type. It also discusses the downsides of type guards and compares them to assertion functions.