title: Why does this JavaScript function return: "0:0function toString() { [native code] }"?
body: <p>I took the following function from <a href="http://www.tek-tips.com/viewthread.cfm?qid=475988&amp;page=970" rel="noreferrer">this site</a> and plugged it into my code to display a user-friendly time string based on a millisecond argument.</p>
  
  <p>Why does this function not work?</p>
  
  <pre><code>    function getTimeFromMillis(millis)
      {
  
          milliSecs = millis;
  
          msSecs = (1000)
          msMins = (msSecs * 60)
          msHours = (msMins * 60)
          numHours = Math.floor(milliSecs/msHours)
          numMins = Math.floor((milliSecs - (numHours * msHours)) / msMins)
          numSecs = Math.floor((milliSecs - (numHours * msHours) - (numMins * msMins))/ msSecs)
  
  
          if (numSecs &lt; 10){
            numSecs = "0" + numSecs.toString
          }
          if (numMins &lt; 10){
            numMins = "0" + numMins.toString
          }
  
          resultString = numHours + ":" + numMins + ":" + numSecs     
          return resultString;
  
      }
  </code></pre>
  
  <p>If I pass it a millisecond value from my calling function I get this:</p>
  
  <pre><code>0:0function toString() { [native code] }:0function toString() { [native code] }
  </code></pre>