3 ms·
You can do that with sum types. type methods = 'a' | 'b' const value: methods = 'c' // error The difference is enums are also nominal, while most type
by seniorsassycat 5y ago
You can do that with sum types.
type methods = 'a' | 'b'
const value: methods = 'c' // error
The difference is enums are also nominal, while most types are structural.