- Expert Angular
- Mathieu Nayrolles Rajesh Gunasundaram Sridhar Rao
- 79字
- 2021-07-15 17:05:30
Enum
The enum data type will have a named set of values. We use enumerators to give user-friendly names to constants that identify certain values:
enum Day {Mon, Tue, Wed, Thu, Fri, Sat, Sun}; var firstDay: Day = Day.Mon;
Here, we have the Day enum variable, which holds a series of values that represent each day of the week. The second statement shows how to access a particular enum value in a day and assign it to another variable.
推薦閱讀
- Embedded Linux Projects Using Yocto Project Cookbook
- HTML5+CSS3王者歸來
- 體驗設計原理:行為、情感和細節
- MATLAB 2020 從入門到精通
- Learning Linux Binary Analysis
- NumPy Essentials
- Mastering OpenCV 4
- Ray分布式機器學習:利用Ray進行大模型的數據處理、訓練、推理和部署
- Learning Apache Kafka(Second Edition)
- OpenShift在企業中的實踐:PaaS DevOps微服務(第2版)
- Bootstrap 4:Responsive Web Design
- Corona SDK Mobile Game Development:Beginner's Guide(Second Edition)
- Quantum Computing and Blockchain in Business
- Hadoop 2.X HDFS源碼剖析
- 從零學Java設計模式