- Home
- /
- Tutorials
- /
- JavaScript Tutorial
- /
- JavaScript Template Literals
JavaScript Strings
JavaScript Template Literals
Template literals use backticks and let you put values directly inside text.
They replace long chains of string joining with something far easier to read.
They also allow real line breaks inside the text.
Example
Example
javascript
const name = "Ada";
console.log(`Hello ${name}`);The output is Hello Ada.
What is a Template Literal?
It is written with backticks instead of quotes.
${'${...}'} inserts the value of any expression.
