News for hackers. Stuff that matters.
Re:TIL: `satisfies` is my favorite TypeScript keyword by ameliaquining on Saturday November 22, 2025 @08:46PM (#46020008)
Discriminating a function or promise based on return type is never going to work, because JavaScript is dynamically typed and TypeScript erases types at compile time, so there's no way to know at runtime what type a function or promise is going to return.
Re:TIL: `satisfies` is my favorite TypeScript keyword by ibejoeb on Sunday November 23, 2025 @11:48AM (#46024927)
It'll work because that's what typescript does, and that's why it needs to be implemented there, also. That's my point.

And as far as runtime goes, well, that's not what typescript does. It's a typical compile-time static type system.

Typescript aside, even a javascript-level first-class pattern expression is still extremely useful. I really hope it gets in there soon.