`\`` === "`"; // trueTemplate literals (Template strings) / notebook
Template literals (Template strings)
Runnable notebook: every JavaScript, HTML and CSS example on this page executes in a sandboxed local frame. Nothing leaves the browser.
`\${1}` === "${1}"; // trueconsole.log("string text line 1\nstring text line 2");
// "string text line 1
// string text line 2"console.log(`string text line 1
string text line 2`);
// "string text line 1
// string text line 2"console.log(`string text line 1 \
string text line 2`);
// "string text line 1 string text line 2"const a = 5;
const b = 10;
console.log("Fifteen is " + (a + b) + " and\nnot " + (2 * a + b) + ".");
// "Fifteen is 15 and
// not 20."const a = 5;
const b = 10;
console.log(`Fifteen is ${a + b} and
not ${2 * a + b}.`);
// "Fifteen is 15 and
// not 20."