I am working on a javascript project that requires the use of javascript "Enums", meaning objects like:
var WinnerEnum = { Player1: 1, Player2: 2, Draw: 0 };
This works fine for me, however, I donβt know how to correctly (according to the convention) name Enum, because as far as I know, only class names begin with a capital letter (indicating the possibility of calling the constructor).
JSHint also displays the following warning:
Missing 'new' prefix when invoking a constructor.
If there is no agreement, I would appreciate a good way to name enumerations that do not confuse them with class names. Update 2014 : JSHint no longer does this.
source share