by yCombLinks · 4y ago · 0 comments
type methods = 'a' | 'b'
const value: methods = 'c' // error
The difference is enums are also nominal, while most types are structural.Mechanically, a const dictionary, or a string union might achieve the same.
But semantically, an enum (sometimes) reads better.