title: Dynamically name a JSON property
body: <p>I've been trying to create a dynamically named JSON property but I keep hitting on errors. Honestly I  don't know if this is possible to achieve with Javascript. Anyway here is my problem.</p>
  
  <p>Let's suppose I'm creating a JSON object like the following code:  </p>
  
  <pre><code>var DTO = { 'NewObject' : GetFormData() };  
  var DTO = { 'UpdateObject' : GetFormData() };  
  var DTO = { 'DelObject' : GetFormData() };  
  </code></pre>
  
  <p>Now what I've been trying to do is to dynamically name the JSON property because with something like <code>'New' + ClassName</code> (<code>ClassName</code> being a var with a string value) but it gives me a syntax error. Is there a way to do this to become something like:</p>
  
  <pre><code>var DTO = { 'New' + ClassName : GetFormData() };  
  var DTO = { 'Update' + ClassName : GetFormData() };  
  var DTO = { 'Delete' + ClassName : GetFormData() };  
  </code></pre>
  
  <p>I really appreciate your help. Thanks.     </p>