Syntax
JavaScript Template Literal Syntax
In JavaScript, template literal: inserts values into a string — `Total: ${total}`
Quick Answer
- Syntax
`Total: ${total}`
JavaScriptSyntax
Template Literal
Code example
`Total: ${total}`
Inserts values into a string.
How to template literal in JavaScript
- Open your JavaScript file or editor.
- Copy the example, then replace its sample names and values for your code.
JavaScript Template Literal Syntax
Use `Total: ${total}`.
Related Syntax References
Frequently asked questions
What is the JavaScript syntax for template literal?
Use this pattern: `Total: ${total}`
Can I copy this JavaScript code example?
Yes. Use Copy code and adapt the example to your program.
Is this JavaScript syntax different on Mac or Windows?
No. The language syntax is the same across operating systems.
Official source · How we verify