Introduction to TypeScript Enums — Const and Ambient Enums

John Au-Yeung
Level Up Coding
Published in
7 min readFeb 6, 2020

--

Photo by Zdeněk Macháček on Unsplash

If we want to define constants in JavaScript, we can use the const keyword. With TypeScript, we have another way to define a set of constants called enums. Enums let us define a list of named constants. It’s handy for defining an entity that can take on a few possible values. In this article, we’ll continue from Part 1 and look at union enums and enum member types, how enums are evaluated…

--

--