forked from tolgaek/node-enum
-
Notifications
You must be signed in to change notification settings - Fork 4
Creation
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.
var days = Enum("Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday");