`half of 100 is ${100 / 2}`
If you are gonna copy and paste answers from MDN... you should AT LEAST
check the page hedaer to see what topic you are copying. That way you don't
post a porno graphic where a 3-D graphic belongs.
`string text`
`string text line 1
string text line 2`
`string text ${expression} string text`
tag`string text ${expression} string text`
// Untagged, these create strings:
`string text`
`string text line 1
string text line 2`
`string text ${expression} string text`
// Tagged, this calls the function "tagFunction" with the template as the
// first argument and substitution values as subsequent arguments:
tagFunction`string text ${expression} string text`
let fourthItem = 'Item 4';
let myHtml = `
<ol class="item-list">
<li>Item 1</li>
<li>Item 2</li>
<li>Item 3</li>
<li>${fourthItem}</li>
</ol>
`;
const str1 = 'This is a string';
// cannot use the same quotes
const str2 = 'A "quote" inside a string'; // valid code
const str3 = 'A 'quote' inside a string'; // Error
const str4 = "Another 'quote' inside a string"; // valid code
const str5 = "Another "quote" inside a string"; // Error