as const

3 videos across 2 channels

Preserving literal types and shaping precise return types with as const can dramatically sharpen TypeScript’s type safety. These videos show how const assertions enable readonly arrays and strict generic returns, illustrate real-world use in advanced codebases and libraries, and discuss when explicit return types beat inference to prevent subtle bugs. They also offer practical tips—narrowing widened types, leveraging discriminated unions, and using utility types—to keep code expressive, maintainable, and friendly to tooling and AI-assisted development.

Stop Writing TypeScript Code Like This thumbnail

Stop Writing TypeScript Code Like This

The video explains why TypeScript’s return type inference is powerful but not always sufficient, and when you should exp

00:12:12
5 Typescript tips you NEED to know thumbnail

5 Typescript tips you NEED to know

The video shares practical TypeScript tips to avoid common pitfalls, focusing on narrowing widened types, using literal

00:18:45