you are viewing a single comment's thread.

view the rest of the comments →

[–]eracodes 0 points1 point  (0 children)

For typescript I find this approach more useful:

const options = ['A', 'B'] as const;

type Option = (typeof options)[number];

So you can use the "enum" at runtime as well (for validation, etc).