BeginnerCoder

Lesson 3 — Template literals

Strings with values

A template literal is a string in backticks (`) instead of quotes. It embeds values with ${...} and can span several lines.

const city = "Paris";
console.log(`I live in ${city}`);
Want it another way?
Task

Log the greeting Hi, Sam! using a template literal with ${name}.

Run your code — when the output matches the task, you will see a green check. Then mark the lesson complete.

← Back
Next →
Test your knowledge

A quick 3-question quiz on this lesson — instant feedback.

Enjoying this lesson? Share it.