Interview Question

What are template literals?

Template literals support interpolation, multiple lines, and tagged processing.

💡 Concept ✅ Quick Revision ⚡ JavaScript

Answer

Template literals are string literals delimited by backticks. • Substitutions evaluate expressions inside `${...}`. • They can contain line terminators without escape sequences. • Tagged templates pass structured template parts to a function.

Example

Code
const name = 'Maya';
console.log(`Hello, ${name}!`);
Output
Hello, Maya!

Quick Revision

Template literals support interpolation, multiple lines, and tagged processing.