title: Last iteration of a loop in JavaScript
body: <p>I want to do something like this:</p>
  
  <pre><code>for (var i=1; i&lt;=10; i++) {
     document.write(i + ",");
  }
  </code></pre>
  
  <p>It shows a result like:</p>
  
  <pre><code>1,2,3,4,5,6,7,8,9,10,
  </code></pre>
  
  <p>But I want to remove the last ",", and the result should be like this:</p>
  
  <pre><code>1,2,3,4,5,6,7,8,9,10
  </code></pre>