javascript split string end of line code example Example: split text by new line javascript myText.split(/\n/)