title: Javascript how to show each element of array on a new line
body: <p>I have a string build form comma separated values I use <code>split</code> to get each value and after that I want to show each value on a new line but what really happens is that I get each value on a new line except of the last two which are shown together on a same line. Just to make it clear:</p>
  <blockquote>
  <p>value1</p>
  <p>,value2</p>
  <p>,value3</p>
  <p>,value4,value5</p>
  </blockquote>
  <p>Here is the function which I'm using:</p>
  <pre><code>_checkDates: function(dates) {
      if (dates != null)
      {
          var zzz = dates.split(',');
          var xxx = zzz.length;
          console.log(xxx);
          for (var i=0; i&lt;=xxx; i++)
          {
              zzz[i] = zzz[i] + '&lt;br /&gt;';
              return zzz;
          }
      }
      return dates;
  }
  </code></pre>
  <p>Just to be clear this is written in ExtJS 4, I'm almost sure that in this case the problem is pure JavaScript and is not related with ExtJS 4 but anyways, maybe I'm wrong.</p>
  <p>So any ideas why does it happen and how I could make that last element to get on a new line as well?</p>