title: Enum object as dictionary key
body: <p>I want to use a so called "enum" object as dictionary key,(actually,it is also a dictionary AFAIK), in JavaScript.</p>
  
  <p>This doesn't work:</p>
  
  <pre><code>    var State ={DEFAULT:0,ACTIVE:1 ,INACTIVE:2,ALERT:3};
  
      var statesDict =  {
        State.ACTIVE : {color:0x00ff00}
        State.INACTIVE: {color:0x000000}
      };
  </code></pre>
  
  <p>while this one does:</p>
  
  <pre><code>   var State ={DEFAULT:0,ACTIVE:1 ,INACTIVE:2,ALERT:3};
  
      var statesDict =  {
        1: {color:0x00ff00}
        2: {color:0x000000}
      };
  </code></pre>
  
  <p>Why? Isn't the <code>State.{prop name}</code> supposed to be replaced by its value? </p>