new Enum(values)
An Enum constructor can take many different types to construct an Enum from:
- String
- Comma-Delimited String
- Object
- Array
- Array of Objects
- Array of Strings
- Array of Arrays of Object
- etc.
Once created an Enum is immutable.
Enums inherit from the Serializable class so it also has:
toObject()
toJSON()
Parameters:
Name | Type | Description |
---|---|---|
values |
Object
|
Array.<(Object|String)>
|
String
|
Extends
Methods
toJSON() → {String}
converts index to an array and stringifies
- Inherited From:
- Source:
Throws:
TypeError
Returns:
- Type:
-
String
toObject() → {Object}
converts a class to an object
- Inherited From:
- Source:
Returns:
- Type:
-
Object