---
source: https://iinventedlight.com/library/notes/typescript-enums.md
title: "TypeScript enums: named constants, numeric or string"
license: CC-BY-4.0
license_url: https://creativecommons.org/licenses/by/4.0/
source_license: "CC BY 4.0 (microsoft/TypeScript-Website); restated in our own words"
attribution: "Summary by iinventedlight (AI-assisted). Sources: Microsoft (TypeScript Handbook), TypeScript: Handbook - Enums, CC BY 4.0 (microsoft/TypeScript-Website); TypeScript (Microsoft), Everyday Types, CC BY 4.0 (microsoft/TypeScript-Website)."
author: "iinventedlight (synthesis of cited sources); text drafted with AI assistance"
date: 2026-11-04
status: published
checked_on: 2026-11-05
as_of: 2026-11-05
confidence: medium
untested: "No code was run; only the fetched documentation pages were read."
category: coding-references
topic_area: "typescript: enums"
tags: typescript, enums, constants
sources:
  - id: S1
    title: "TypeScript: Handbook - Enums"
    publisher: Microsoft (TypeScript Handbook)
    url: https://www.typescriptlang.org/docs/handbook/enums.html
    accessed: 2026-11-05
    license: "CC BY 4.0 (microsoft/TypeScript-Website)"
  - id: S2
    title: "Everyday Types"
    publisher: TypeScript (Microsoft)
    url: https://www.typescriptlang.org/docs/handbook/2/everyday-types.html
    accessed: 2026-11-05
    license: "CC BY 4.0 (microsoft/TypeScript-Website)"
    license: "CC BY 4.0 (microsoft/TypeScript-Website)"
---
# TypeScript enums

## Short answer
Enums define a set of named constants. TypeScript supports numeric and string enums; they exist as real objects at runtime. Union and literal types are often a lighter alternative. [S1][S2]

## Points
- Members after an initializer auto-increment for numeric enums. [S1]
- Prefer string enums when you care about readable runtime values. [S1]
- Union types combine existing types; each piece is a union member. [S2]

## Claims
- id: C1
  claim: Enums define a set of named constants.
  source: S1
  evidence: "Enums allow a developer to define a set of named constants"
- id: C2
  claim: TypeScript has numeric and string enums.
  source: S1
  evidence: "TypeScript provides both numeric and string-based enums"
- id: C3
  claim: Enums exist as real runtime objects.
  source: S1
  evidence: "real objects that exist at runtime"
- id: C4
  claim: Union types combine existing types into members.
  source: S2
  evidence: "each of these types as the union’s members"

## Sources
- [S1] TypeScript: Handbook - Enums. Microsoft (TypeScript Handbook). https://www.typescriptlang.org/docs/handbook/enums.html . License: CC BY 4.0 (microsoft/TypeScript-Website). Accessed 2026-11-05.
- [S2] Everyday Types. TypeScript (Microsoft). https://www.typescriptlang.org/docs/handbook/2/everyday-types.html . License: CC BY 4.0 (microsoft/TypeScript-Website). Accessed 2026-11-05.

License: this note is CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/). Summary by iinventedlight (AI-assisted).

Source notice: TypeScript Handbook / Website docs © Microsoft. Licensed under Creative Commons Attribution 4.0 International (https://github.com/microsoft/TypeScript-Website/blob/v2/LICENSE).
