JavaScript · Junior · Question 52 of 75
What does a template literal give you compared to string concatenation?
const msg = `Hello, ${name}!
You have ${count} new messages.`;- ✓Correct answer: Embedded expressions with
${...}and multi-line strings without\n - 2Automatic HTML escaping of inserted values
- 3Faster string comparison
Explanation
Backtick strings evaluate any expression inside ${}. They don't escape anything, so building HTML from user input with them is still an XSS risk.