title: "Unexpected end of input" in javascript program
body: <p></p>
  
  <pre><code>&lt;html&gt;
  &lt;head&gt;
  &lt;title&gt;
  &lt;/title&gt;
  
  &lt;script&gt;
  var n = 2;
  var days = 365;
  
  function factorial() {
          var result = 1;
          for (var i = 1; i &lt;= n; i++) {
              result *= i
        }
         return result;
      }  
  
  var theNumber = function baseExponent (base, exponent) {
      var number = 1;
      for (i=0; i &lt; exponent; i++) {
          var number = base * number;
      }
      return number
  }
  
  
  document.write(factorial()*182)/(theNumber(days, n)
  //i used the (formula n! * combination 365 2)/365^n
  //i cheated a bit and just did the math for parts of this specific problem
  &lt;/script&gt;
  &lt;/head&gt;
  &lt;body&gt;
  
  
  
  
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>i am getting an "Uncaught syntax error: unexpected end of input" for my  tag and I can't figure out why. Any ideas?</p>