title: How to build/concatenate strings in JavaScript?
body: <p>Does JavaScript support substitution/interpolation?</p>
  <h1>Overview</h1>
  <hr />
  <p>I'm working on a JS project, and as it's getting bigger, keeping strings in good shape is getting a lot harder. I'm wondering what's the easiest and most conventional way to construct or build strings in JavaScript.</p>
  <p>My experience so far:</p>
  <blockquote>
  <p>String concatenation starts looking ugly and becomes harder to maintain as the project becomes more complex.</p>
  </blockquote>
  <p>The most important this at this point is succinctness and readability, think a bunch of moving parts, not just 2-3 variables.</p>
  <p>It's also important that it's supported by major browsers as of today (i.e at least ES5 supported).</p>
  <p>I'm aware of the JS concatenation shorthand:</p>
  <pre><code>var x = 'Hello';
  var y = 'world';
  console.log(x + ', ' + y);
  </code></pre>
  <p>And of the <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/concat" rel="nofollow noreferrer">String.concat</a> function.</p>
  <p>I'm looking for something a bit neater.</p>
  <p>Ruby and Swift do it in an interesting way.</p>
  <p><strong>Ruby</strong></p>
  <pre><code>var x = 'Hello'
  var y = 'world'
  print &quot;#{x}, #{y}&quot;
  </code></pre>
  <p><strong>Swift</strong></p>
  <pre><code>var x = &quot;Hello&quot;
  var y = &quot;world&quot;
  println(&quot;\(x), \(y)&quot;)
  </code></pre>
  <p>I was thinking that there might be something like that in JavaScript maybe something similar to <a href="https://github.com/alexei/sprintf.js" rel="nofollow noreferrer">sprintf.js</a>.</p>
  <h1>Question</h1>
  <hr />
  <p>Can this be done without any third party library? If not, what can I use?</p>