How to use template to create multiple lines string in JavaScript ES6

1 Answer

0 votes
const HTML = `
    <!doctype html>
    <html>
    <head>
        <meta charset="UTF-8">
        <title></title>
    </head>
    <body>
        <h1>HTML</h1>
    </body>
    </html>`


console.log(HTML);



     
/*
run:
   
<!doctype html>
<html>
<head>
    <meta charset="UTF-8">
    <title></title>
</head>
<body>
    <h1>HTML</h1>
</body>
</html>
 
*/

 



answered Mar 8, 2020 by avibootz

Related questions

...