Рет қаралды 111,123
'as const' is an amazingly useful TypeScript feature that most people still don't know about.
00:00 SO underrated
00:12 Objects are mutable!
01:54 How as const works
02:38 Object.freeze
03:19 Deriving types from as const
04:30 keyof typeof
Become a TypeScript Wizard with my free beginners TypeScript Course:
www.totaltypescript.com/tutor...
Follow Matt on Twitter
/ mattpocockuk
Join the Discord:
mattpocock.com/discord