TypeScript for Beginners by Sufyan bin Uzayr;

TypeScript for Beginners by Sufyan bin Uzayr;

Author:Sufyan bin Uzayr;
Language: eng
Format: epub
Publisher: CRC Press (Unlimited)
Published: 2022-01-19T00:00:00+00:00


compiled in:

var Enum;

(function (Enum) {

Enum[Enum["A"] = 0] = "A";

})(Enum || (Enum = {}));

var a = Enum.A;

var nameOfA = Enum[Enum.A]; // "A"

In the generated code, the enumeration is compiled into an object that stores the forward (name -> value) and reverse (value -> name) mappings. References to enum elements are always executed as property accesses and are never embedded. In many cases, this is the right solution. However, sometimes the requirements are tougher. To avoid paying the cost of additional generated code and indirect access when accessing enumeration values, you can use constant enumerations. Constant enumerations are defined using the const modifier preceding the enum keyword.



Download



Copyright Disclaimer:
This site does not store any files on its server. We only index and link to content provided by other sites. Please contact the content providers to delete copyright contents if any and email us, we'll remove relevant links or contents immediately.