“JavaScript Multiline String” Kode Jawaban

JavaScript Multiline String


// 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
Jacques_Kirstein

string multilin JS dengan variabel

const htmlString = `${user.name} liked your post about strings`;
FishBrawler

JavaScript Multiline String

    // 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);
Anthony Smith

Beberapa string baris di JS

const text = `Using the backtick character
you can define a string that
spans multiple lines.`;
Toutou Toutou

Jawaban yang mirip dengan “JavaScript Multiline String”

Pertanyaan yang mirip dengan “JavaScript Multiline String”

Jelajahi jawaban kode populer menurut bahasa

Jelajahi bahasa kode lainnya