ES6: Template Literals

3min read

Template Literals are a very comfortable way to concatenate strings and variables that hold values.

ES5

In ES5 we were used to concatenate strings and variables with “+” …

ES6

…in ES6 we simply wrap the whole output in backticks ` ` and variables in ${variablename}.

By the way, Template Literals work also across multiple lines.