title: object oriented javascript how to create a static class for constants
body: <p>I've decided to put all my constants in a neat class called constants, and would like to access its members with the dot operator.</p>
  
  <p>So far I've tried:</p>
  
  <pre><code>function Constants(){
      Constants.style = {};
      Constants.style.border_sides = 20;
      Constants.style.button_width = 17;
      // ...
  }
  </code></pre>
  
  <p>And later</p>
  
  <pre><code>Constants = new Constants();
  </code></pre>
  
  <p>and</p>
  
  <pre><code>{
      $('#button').width(Constants.style.button_width);
  }
  </code></pre>
  
  <p>That resulted in a </p>
  
  <blockquote>
    <p>Can't access button_width of undefined.</p>
  </blockquote>
  
  <p>I would use JSON to declare the constants, but I like comments in my code.
  Would someone explain javascript's OO?</p>