What is the use of return statement inside a function?
<pre><code>    var obj = {

        func: function() {    
        return: {
           add: function() {
             }
          } 
        },
        somefunc: function() {
      }
   } 
</code></pre>

<p>The orginal code behind where i used to convert this... </p>

<pre><code>var hash = (function() {
     var keys = {};
     return {         
     contains: function(key) {
     return keys[key] === true;         
     },
     add: function(key) { 
     if (keys[key] !== true){
         keys[key] = true;             
     }     
  }; 
})();
</code></pre>

<p>Questions:</p>

<ol>
<li>What is the use of return keyword?</li>
<li>Can i structure like this, my class?</li>
</ol>
