Javascript template literals are enclosed by the back-tick (
) character instead of the double or single quotes. These are indicated by a dollar sign and curly braces (${expression}). Template literals are the string literals allowing embedded expressions. You can use the multi-line strings and string interpolation features with them.
Template literals are quite simply the easiest way to improve your JavaScript code readability when working with Strings. Let’s break down a Template Literal.
Template Literals are the new ES2015 / ES6 feature that allows you to work with strings in a great way compared to ES5 and below. The syntax at first glance is straightforward, use backticks instead of single or double-quotes.
const madTitan = `Thanos`;
#javascript #expression #js