title: "Class" constants and constructor: how to implement?
body: <p>I would like to have something like this implemented in javasript please:</p>
  
  <pre><code>var hat = new Hat(Hat.Color.RED, Hat.Size.MEDIUM);
  </code></pre>
  
  <p>How can I do it please (tried to mess with function <code>prototype</code> but with a little success)?</p>