ES6 Template Literals

In ES5 to create a dynamic string, static string parts have to be concatenated with Javascript variables. ES6 introduces template literals using which manual concatenation can be avoided. See the example below.

Make sure that the dynamic string is enclosed in ` `, not in ‘ ‘ or “ “

Share