js split new lines code example
Example 1: split text by new line javascript
myText.split(/\n/)
Example 2: string split javascript newline
let string = "Hi\nHow are you?"
let newstrings = string.split("\n"); // [ "Hi", "How are you?" ]
myText.split(/\n/)
let string = "Hi\nHow are you?"
let newstrings = string.split("\n"); // [ "Hi", "How are you?" ]