Loading video...
Video Failed to Load
Here's two TypeScript tips rolled into one: 1. TypeScript magic is everywhere, even in Node's built-in types 2. I bet you didn't know this was legal TS: error: [message: string]
80,986 views • 1 year ago •via X (Twitter)
10 Comments

My course is 30% off right now!

wait this was so easy!!. 2yrs ago i use to copy over this to every project

I did not know that you could name the items in a tuple type. Gonna go fix some that I have that are less than clear right now!

Great for things like: type Position = [x: number, y: number, z?: number]

That error type trick is defs something I would've never guessed, Matt's got all the good stuff lol

This has to be new! Nice to see this. Alas, no strongly-typed events for EventTarget in lib.dom. That's why I built Rettime ( That and also a bunch of other reasons.

How strange, I just discovered this yesterday accidentally 😂😂

Vue uses this exact pattern for component defineEmits.

Bruh... U trying to sell ur course talking about basic things Rly?

TypeScript out here making tuples feel like dark arts. 🧙♂️🌀
