I have some text "lorem ipsum^^^text^^^testtext" that I want to split onto new lines. I'm using split to separate the text into an array like so:
var companySplit = this.company.split('^^^');
and I can output this like so:
$("#company").html(companySplit[0] + '<br />' + companySplit[1]);
However, In certain situations, there may not be 2 array items...There could be 3 or 4 for example. How can I display the array items separated by a line break regardless of the amount of items? I've tried using a loop but I'm unfamiliar with them so I had trouble getting it working.