1document.write("\n");
2//second method for html page
3document.write("<br>");
1//in JavaScript, you can declare a line break (or new line)
2//with the \n character.
3var linebreak = '\n';
1let multilineString = `My
2text\r1\r\n2\n3\n\r4
3is
4here`;
5
6let htmlText = multilineString.replace(/(\r\n|\n\r|\r|\n)/g, '<br>');
7
8console.log('Multiline string: ' + multilineString);
9console.log('HTML text: ' + htmlText);