Accessing Data Member
<p>I've create a namespace like the one below.</p>

<pre><code>var Constants = {
    Foo: 'bar',
    SomeVar: {
       key: 'value'
    }
};
</code></pre>

<p>What I want to do is:</p>

<pre><code>var Constants = {
    Foo: 'bar',
    SomeVar: {
       key: Constants.Foo + 'value' // Notice the Constants.Foo
    }
};
</code></pre>

<p>What I want to do is be able to use the value of <strong>Constants.Foo</strong> to create a value for <strong>SomeVar</strong>. However this throws an error in Firebug.</p>

<p>So I'm wondering, how do I access the value of Foo inside the Constants namespace; and also, I've been reading a few articles on encapsulation in Javascript (like <a href="http://www.codeproject.com/Articles/108786/Encapsulation-in-JavaScript" rel="nofollow">this</a> one), is it possible to access value of Foo without having to do Constants.Foo? Perhaps some sort of way to preserve a reference to the namespace's <em>this</em> keyword and then I can do something like <em>thisParent.Foo</em>.</p>

<p>Thanks!</p>

<hr>

<p>EDIT:</p>

<p>This is the error I'm getting by the way:</p>

<blockquote>
  <p>TypeError: Constants is undefined</p>
</blockquote>
