Javascript Aside: Node, ES6, and Template Literals
Big word
Template Literal: A way to concatenate strings in Javascript(ES6)
Easier to work with than a bunch of strings concatenated with '+'
The code
var name = 'John Doe';
var greet = 'Hello ' + name;
var greet2 = `Hello ${ name }`;
console.log(greet);
console.log(greet2);
- You need to configure a JSON to let engine know you're using ES6
{
"compilerOptions": {
"target": "ES6"
}
}