- Using template literals:
In this example, template literals are used to create a multi-line string. The string is defined using backticks (
`) instead of quotes (
"), and line breaks are automatically included in the final string.
- Using string concatenation:
In this example, a multi-line string is created by concatenating multiple strings using the
+ operator. The
\n escape character is used to insert a line break between each string.