560

January 9th, 2023 × #TypeScript#JavaScript#Web Development

TypeScript Fundamentals × Satisfies and as const

Scott and Wes discuss new TypeScript techniques like 'as const' to create frozen read-only types from data and 'satisfies' to allow better inference for unknown metadata objects.

or

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

Share

Play / pause the audio
Minimize / expand the player
Mute / unmute the audio
Seek backward 30 seconds
Seek forward 30 seconds
Increase playback rate
Decrease playback rate
Show / hide this window