JavaScript
String concatenation vs String Templates

by Florian Keller

const hello = 'Hello, ';
const name = 'World';
const greeting = hello + name;

const hello = 'Hello, ';
const name = 'World';
const greeting = `${hello}${name}`;

const greeting = [hello, name].join('');

;P

AndyTheGiant

TSLint supports a combination of both using allow-single-concat: https://palantir.github.io/tslint/rules/prefer-template/

Benny Neugebauer

Sign in to comment!