News for hackers. Stuff that matters.
Re:Flatten Arrays in Vanilla JavaScript with Flat() and Flat... by amitport on Wednesday January 05, 2022 @10:07PM (#29818780)
Oh so there is an overload!

filter<U extends T>(pred: (a: T) => a is U): U[];

Additionally, getting TS better at inferring type guards is an open issue (literally): https://github.com/microsoft/TypeScript/issues/38390

There are no comments on this comment yet.