Extending javascript object
<p>I already have this:</p>

<pre><code>var myVar = { appName: 'Test' };
</code></pre>

<p>I want to add this:</p>

<pre><code>myVar = {
         exec: function()
             {
                console.log('do stuff');  
             } 
         }
</code></pre>

<p>And have this:</p>

<pre><code>   myVar = {
               appName: 'Test',
               exec: function()
               {
                 console.log('do stuff');  
               } 
           }
</code></pre>

<p>Actually, I want to be able to access myVar.appName and myVar.exec();</p>

<p>So, I can:</p>

<pre><code>myVar.exec = function(){};
</code></pre>

<p>But if I have many more functions and variables.</p>

<p>Do I have to keep doing this:</p>

<pre><code>myVar.func1 = function(){ // stuff 1 };
myVar.func2 = function(){ // stuff 2 };
myVar.func3 = function(){ // stuff 3 };
</code></pre>

<p>Are there a better way?</p>

<p>Thanks :)</p>
