title: Writing the Key of JSON with an enum
body: <p>I was trying to extract strings with using an enum such as:</p>
  
  <pre><code>var INGREDIENT = { COFFEE: "coffee"}
  </code></pre>
  
  <p>and then later wanted to have a cost scale for the ingredients</p>
  
  <pre><code>var COST = { coffee: 1 }
  </code></pre>
  
  <p>but i wanted to extract coffee to use the string:  INGREDIENT.COFFEE like so:</p>
  
  <pre><code>var COST = {INGREDIENT.COFFEE: 1 };  //target
  </code></pre>
  
  <p>but it was showing an error that <code>.</code> is incorrect.</p>
  
  <p>I was resorting to:</p>
  
  <pre><code>var COST= {};
  COST[INGREDIENT.COFFEE] = 1;
  </code></pre>
  
  <p>Is there something i am doing, preventing me from doing it like my <code>//target</code></p>