Constructor
new Enum(name, ordinal)
Creates an enum object.
Parameters:
Name | Type | Description |
---|---|---|
name |
string | The name of the enum constant. |
ordinal |
number | The ordinal of the enum constant. |
Methods
toJSON() → {string}
Returns the name of the enum constant.
Returns:
The name of the enum constant.
- Type
- string
toString() → {string}
Returns the name of the enum constant.
Returns:
The name of the enum constant.
- Type
- string
valueOf() → {number}
Returns the ordinal of the enum constant.
Returns:
The ordinal of the enum constant.
- Type
- number
(static) valueOf(name) → {Enum}
Returns an enum constant by its name.
Parameters:
Name | Type | Description |
---|---|---|
name |
string | The name of the enum constant. |
Returns:
The enum constant.
- Type
- Enum
(static) values() → {Array.<Enum>}
Returns all enum constants.
Returns:
All enum constants.
- Type
- Array.<Enum>