Types Go Brrr
Nobody has said anything yet. Be the first.
TypeScript types, generics and compiler errors
TypeScript, from "why is this any" to conditional types nobody can read. Generics, inference, and knowing when to stop.
Paste the error in full
The useful half of a TypeScript error is usually the last four lines.
Bring the detail
Versions, error text, what you already tried. "It does not work" is not a question anyone can answer.
No drive-by self promotion
Share your own work when it answers the thread. A link with no context is a advert, and it gets removed.
Nobody has said anything yet. Be the first.
Showing 2 posts.
my senior left a review comment "these are not the same thing" on this: type User = { name?: string } type User2 = { name: string | undefined } in my head both mean "name might be undefined". when i hover in vscode they look almost the same. whats the real difference and when would i pick one over the other? i googled and found something about exactOptionalPropertyTypes and now im more confused lol
i wrote ruby for five years before rust. in ruby every variable is a reference to an object somewhere, the garbage collector cleans up after you, and you never think about who "owns" anything. so my first month of rust was mostly me yelling at the compiler. here are the three errors i hit most, translated for past me. if you want the 100 second version of rust first, fireship's is honestly good: 1. E0382: the value…