1×
Become a member
to unlock all features
Autoplay

    Collect Related Strings in a String Enum in TypeScript

    typescriptTypeScript
    ^2.0.0

    As of TypeScript 2.4, it is now possible to define string enums, or more precisely, enums with string members. Just like any other numeric enum, string enums can be made constant using the const modifier so that they disappear entirely from the generated JavaScript; in this case, all enum values will be inlined into the output.