Let's have a look at them!
The first way to make a line break is to use an escape sequence. Escape sequences are sequences of characters with a particular role depending on where they are placed in a string.
There are many of them, but we are interested in the new line character representing a line break (
console.log('Hello World!\nHow are you?') /* Hello World! How are you? */
console.log(`Hello World! How are you?`) /* Hello World! How are you? */
<br> HTML tag. You can use it in an HTML string, and like the new line character
<br> tag will be interpreted in the HTML code as a line break.
document.write to write in your HTML DOM.
document.write('Hello World!<br/>How are you?')
Here is an example of output that you can generate with the above instruction:
<body> Hello World! <br /> How are you? </body>