convert textareas string value to JavaScript array separated by new lines
问题 I have a textarea where the user can write up to 1000 characters. I need to get the jQuery('#textarea').val() and create an array where each item is a line of the textarea 's value. That means: This is a nice line inside the textarea. This is another line. (let's asume this line is empty - it should be ignored). Someone left more than 2 new lines above. Should be converted to a JavaScript array: var texts = []; text[0] = 'This is a nice line inside the textarea.'; text[1] = 'This is another