Concat vs Literal

Edit on GitHub

Setup

var foo = "foo";
var bar = "bar";

Tests

  • Concat

    console.log(foo + " and" + bar);
  • Literal

    console.log(`${foo} and ${bar}`);