title: Need some help understanding basics about JS module pattern
body: <p>I am trying to organize my code using the revealing module pattern.
  I have a very basic question about how to set up a setter method.  </p>
  
  <pre><code>$(document).ready(function() {  
      var designs = (function() {  
          var curRow,  
              setCurRow = function(val) {  
                  curRow = val;  
              },
              initTable = function() {  
                  setCurRow(0);
              };
          return {
              curRow : curRow,
              setCurRow : setCurRow,
              initTable : initTable
          }
      }) ();  
      designs.initTable();  
      designs.setCurRow(someNewVal);
      console.log(designs.curRow);
  });
  </code></pre>
  
  <p>The problem is that i dont get the someNewVal in the console output, I get <code>undefined</code> instead! I have a feeling I am doing something pretty silly here.</p>