Template Literals
Overview
Template literals in JavaScript are a way to create strings that allow embedded expressions and multiline text.
Use backticks (`) instead of quotes
Can include expressions using ${...} syntax
Preserve line breaks and spacing
Don't need to escape single or double quotes
Can include any valid JavaScript expression inside ${...}
Pens
Fork each pen, and solve per instructions.
Template Literal 1
Template Literal 2
Template Literal 3
Template Literal 4
Tagged-Template Literal 1
Tagged-Template Literal 2
References
Template Literals (YouTube video)
Last updated