Template Literals
String interpolation with backticks.
Examples
Variable Interpolation
Inserting variables directly into a string.
let firstName = "John";
let lastName = "Doe";
let text = `Welcome ${firstName}, ${lastName}!`;
console.log(text);Expression Interpolation
Evaluating expressions inside ${...}.
let price = 10;
let VAT = 0.25;
let total = `Total: ${(price * (1 + VAT)).toFixed(2)}`;
console.log(total);Test Your Knowledge
JavaScript Quiz
No quiz available for this topic yet.