how to split through \n in javascript code example Example: split text by new line javascript myText.split(/\n/)