As mentioned on SO

https://stackoverflow.com/questions/287903/enums-in-javascript/287917?noredirect=1#comment35067476_287917