Need readable text or markup across several lines? A JavaScript template literal uses backticks and lets the literal itself span lines. The line break becomes part of the string; unlike a quoted string containing `\n`, the source is written on multiple lines. section 7.1
A line break in the literal
`Hello,\nWorld` written with an actual line break between “Hello,” and “World” produces a string containing that line break. section 7.1
function getProductHTML(product) {
return `
<div class="product">
<div class="product-image">
<img alt="${product.name}" src="${product.image_url}">
</div>
<div class="product-desc">${product.desc}</div>
</div>
`;
}
See a product HTML template laid out across lines, with product values interpolated into the markup. section 7.1


