4 ways to use the TypeScript infer keyword

4 ways to use the TypeScript infer keyword

14.346 Lượt nghe
4 ways to use the TypeScript infer keyword
I've always been a little baffled by TypeScript's `infer` keyword? So I explored the ways you can use it, and came up with 4 variations! If you have other fun examples of how to use `infer`, let me know in the comments! 0:00 - Intro 0:32 - Generic Arguments 2:25 - Arrays 4:37 - Function Parameters and Return type 7:03 - Template Literals 9:53 - Outro