I have a string string form, separated by commas. I use split to get each value, and after that I want to show every value in a new line, but what really happens is that I get every value in a new line, except for the last two, which are shown together on the same line. Just to make it clear:
value1
value2
value3
value4, value5
Here is the function I'm using:
_checkDates: function(dates) { if (dates != null) { var zzz = dates.split(','); var xxx = zzz.length; console.log(xxx); for (var i=0; i<=xxx; i++) { zzz[i] = zzz[i] + '<br />'; return zzz; } } return dates; }
Just to be clear, this is written in ExtJS 4, I'm pretty sure that in this case the problem is pure JavaScript and not related to ExtJS 4, but in any case, maybe I'm wrong.
So, any ideas why this is happening, and how could I make this last element also available on a new line?
thanks
Leron
Leron
source share