title: Javascript equivalent of Java static final String or enum for accessing member names
body: <p>I have a server-side javascript file that translates an XML request to a JSON response (and vice-versa) and performs some business logic. </p>
  
  <p>The XML element names come from a schema that is part of a different project.</p>
  
  <p>To prevent minor typo's from causing major bugs, and to make dealing with schema changes relatively painless, I would like to extract the element names to variables. </p>
  
  <p>In Java, I would either use variables of the type static final String or an enum to do this.</p>
  
  <pre><code>public class Names {
      public final static String CUSTOMER_ZIPCODE = "POstal_code";
      public final static String CUSTOMER_LASTNAME = "last-name";
      public final static String EMPLOYEE_LASTNAME = "lastName";
  }
  </code></pre>
  
  <p>Now when element names change in the schema, I just update the Names class. (Notice also the real-world inconsistent spelling of elements.)</p>
  
  <p>The variables can then be used:</p>
  
  <pre><code>createElement(Names.CUSTOMER_LASTNAME, "Spolsky");
  </code></pre>
  
  <p>Resulting in:</p>
  
  <pre><code>&lt;bla:last-name&gt;Spolsky&lt;/bla:last-name&gt;
  </code></pre>
  
  <p>Is there any way to do this is javascript?</p>