2 ms·
I agree and I'd like to add that if someone wants to throw an error for invalid type casts, they can use assertion functions. https://www.typescriptlang.org/do
by mcluck 4y ago
I agree and I'd like to add that if someone wants to throw an error for invalid type casts, they can use assertion functions.
https://www.typescriptlang.org/docs/handbook/release-notes/typescript-3-7.html#assertion-functions https://www.typescriptlang.org/docs/handbook/release-notes/t...
- eyelidlessness 4y agoThat’s an option I considered mentioning, but it has some weird ergonomics that many people won’t like.