Template Literal Multi-line
Multiple Choice Easy
Question
Can template literals span multiple lines?
Hint
Backticks allow multi-line strings.
Explanation
Template literals (backticks) allow multi-line strings without needing \n or concatenation. The line breaks in the source code are preserved in the string. Regular strings with single or double quotes cannot span multiple lines without using \n or string concatenation. This makes template literals ideal for HTML templates and long text.
Related Resources
Related Lessons
- Data Types
Learn JS data types.
Look up unfamiliar terms
A beginner-friendly glossary explains jargon in plain English — variables, functions, DOM, Promise, and more.
Decode error messages
Plain-English explanations of common errors — what they mean, why they happen, and how to fix them.
Build real projects
Apply what you learned by building guided projects with starter code and solutions.