Alternate definition

suggest change

The Object.freeze() method is available since version 5.1. For older versions, you can use the following code (note that it also works in versions 5.1 and later):

var ColorsEnum = {
    WHITE: 0,
    GRAY: 1,
    BLACK: 2
}
// Define a variable with a value from the enum
var currentColor = ColorsEnum.GRAY;

Feedback about page:

Feedback:
Optional: your email if you want me to get back to you:


Enumerations:
*Alternate definition

Table Of Contents
16Map
17Set
67Enumerations