We're gonna cover two things that are Aren't really related but kind of in the same headspace. The first one is What's called a const assertion in TypeScript? You might have seen it once or twice where at the end of a very variable declaration somebody tax on as const And then the second one is something that's new in I believe TypeScript 4.9 Which is what's called satisfies? And we'll talk about what specific use case you might want to use that In Typecript is kind of kind of cool.
In this Hasty Treat, Scott and Wes talk about Satisfies and as const.
Show Notes
export const currencies = { USD: 'US Dollars', CAD: 'Canadian Dollar', EUR: 'Euro', } as const; export type Currency = typeof currencies; export type CurrencyCode = keyof Currency;
Tweet us your tasty treats