title: JavaScript insert new line to any space in the middle of string
body: <p>I would like to insert only 1 new line character roughly in the middle of a string:</p>
  
  <pre><code>for (var i=0; i&lt;labels.length; i++){
        if (labels[i].length &gt; 30) {
                 //The split would occur here 
        }
  }
  </code></pre>
  
  <p>Is there some JS function that does this?</p>
  
  <p>Any ideas?</p>