xxxxxxxxxx
// Using backticks (`) to create a multiline string
const multilineString = `
This is a
multiline
string.
`;
console.log(multilineString);
xxxxxxxxxx
//Multiple Line String
const multiline = `I am Shahnewaz
I am Web Developer
I am a Programmer
I am a Engineer
`;
console.log(multiline); //I am Shahnewaz I am Web Developer I am a Programmer I am a Engineer
xxxxxxxxxx
// OPTION 1
var MultilineString = `This
is
a multiline
string`; // Note: use the template quotation marks above the tab key
// OPTION 2
var MultilineString = 'This \n\
is \n\
a multiline \n\
string'; // Note: use the "\n\" as a newline character
xxxxxxxxxx
// Creating multi-line string
var str = `<div class="content">
<h1>This is a heading</h1>
<p>This is a paragraph of text.</p>
</div>`;
// Printing the string
document.write(str);
xxxxxxxxxx
const htmlString = `${user.name} liked your post about strings`;
xxxxxxxxxx
const text = `Using the backtick character
you can define a string that
spans multiple lines.`;