Skip to main content
Use enum to restrict a field to a list of allowed values.

Basic usage

Use enums for categories and statuses so outputs stay predictable.

Mixed-type enums

enum values are not restricted to strings:
For single-value enums, use const instead.