TypeScript Basics 18 - Enums

preview_player
Показать описание

Learn how to use enums in TypeScript to create a group of constant values and giving them readable names and an enumeration type.

Course: TypeScript Basics
Learn about the basics of TypeScript. Understand how types work, how to use arrays and tuples, how to declare classes and interfaces. Understand concepts of type erasure, duck typing, enums, generics and modules. Create a development workflow and configure the TypeScript compiler to your needs. And watch as I build an end-to-end TypeScript application from scratch.
Рекомендации по теме
Комментарии
Автор

finally a video that explains it clearly

yadusolparterre
Автор

Thank you. The best explanation and example I have found in this. So it is an array under the hood. And the only benefit to using this rather than just making an array is the meaning it gives your source code correct?

mitchellmigala
Автор

Can you give the example of why we assign values to enum entries (what you did at the end of video)?

SamiullahKhan
Автор

why was tsc showing error on line 1 and 5?

alokbhat
Автор

4:11 isn't that an object and not an array? Only if you argue that an Array is an object with keys 1, 2, 3 you could argue that it's an array-like data structure. But would still be missing the Array prototype.

florianmartens
Автор

Thanks for clear explanation, 1 Doubt I have :
What is the difference between let and var ? Sometimes you are using var or sometimes let

arjunswami
Автор

I cant really see when can it be better than a simple JS object. Can someone explain it to me when can it be more useful?

leventemathe
Автор

What makes triple equal to be 3 lines?

btkfrank
Автор

instead of using "let", can "var" be used?

happyeaters
Автор

This is very much different from java enum :(

suryasikharej