Skip to content
Supuhstar edited this page Apr 9, 2014 · 1 revision

After including micro-enum.js in your page, to create a new enum, simply create a new variable with an arbitrary name, and set it equal to the return of the Enum function. Inside the Enum function, you list any number of keys as strings. The text in these strings have the same constraints as JavaScript variable names. No exception will be thrown if you use whitespace or any other special character, but it will also not be accessible as it should be.

Example

var days = Enum("Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday");

See Also

  • Features for what you get with this
  • Use for how to use this
Clone this wiki locally