title: Javascript date object confusion
body: <p>The question on my homework is this:  </p>
  
  <blockquote>
    <p>Create a function called dateUS( ). </p>
    
    <p>This function will accept a Date object as a parameter. It will return a string in the following format 'mm/dd/yyyy' based upon the value of the parameter.</p>
  </blockquote>
  
  <p>The code I have written is this:</p>
  
  <pre><code>function getMonth(today) {
    var inMo = today.getMonth();  
    inMo += 1;        
    return inMo;                      
  }
  
  function dateUS(inDate) {
    document.write(getMonth(today) + "/" + today.getDate() + "/" + today.getFullYear());
  }
  </code></pre>
  
  <p>I don't understand what "inDate" is doing in this code? And I'm wondering if that is why I'm getting an output of this: <code>5/7/2014undefined</code></p>
  
  <p>I don't understand the "accepting a Date object as a parameter" can someone explain? Keep it simple please. This is a Javascript 101 class and I'm just learning. Thank you so much for your help.</p>