Creating a multiline string using the newline character
Before ECMAScript 6 (ES6), newlines and string concatenation broke a string into multiple lines. Newlines are part of a string. The newline character is denoted by "\n". We can use this character to stretch our string across multiple lines.
Creating a multiline string using concatenation
For readability, it was possible to split a long string into several lines and concatenate using the (+) operator. This approach is helpful if you have multiple lines that you want to display on different lines, but your code can still get messy quickly.
Creating a multiline string using template literals
Template literals are a recent addition to JavaScript that allows you to create multiline strings, make your code cleaner, and eliminate unnecessary special characters. For comparison, we rewrite the code above using template literal.
Another advantage of template string literals is that you can use variables in a string. To do this, you use the "${variable_name}" syntax to add variables inside a string.