Hacker News new | past | comments | ask | show | jobs | submit login

Typescript has actual enums. They behave just like Go's (for better or worse).

It's not clear why Rust got confused.




yep, sorry about that, I misremembered TypeScript as having the same "kind of enums" as Rust.


TypeScript has discriminated unions if that's what you were thinking of

https://www.typescriptlang.org/docs/handbook/2/narrowing.htm...




Consider applying for YC's Spring batch! Applications are open till Feb 11.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: