title: ES6 when to use String.raw over default template literal
body: <p>I'm trying to concatenate a bunch of strings to build a query string in Javascript. Previously I have achieved this through ugly string concatenation:</p>
  
  <pre><code>var queryString = "?action=" + actionValue + "&amp;data=" + dataValue";
  </code></pre>
  
  <p>But with ES6 I see that there are new methods provided that could help me achieve the same result with much nicer looking code, like <em>string interpolation in C# 6:</em></p>
  
  <pre><code>string s = $"action={actionValue}&amp;data={dataValue}"
  </code></pre>
  
  <p>I have tested with both default template literal and <code>String.raw</code> and although the syntax for each is slightly different, they both work. I'm leaning towards using <code>String.raw</code> in my final copy as it doesn't allow for the string to be tagged and thus tinkered with in the future like the default template literal does.</p>
  
  <p>Although it does say in the <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/template_strings#Raw_strings" rel="nofollow">MDN docs</a> that <code>String.raw</code> basically calls the default template literal method but I like the syntax of <code>String.raw</code> better... I am calling the <code>String.join</code> method inside the curly braces of my string that I am formatting so maybe that is a misuse of <code>String.raw</code>.</p>
  
  <p>Are any ES6 wizards out there able to enlighten me and provide reasons for one over the other?</p>
  
  <p>My code:</p>
  
  <pre><code>var defaultTemplateStringUrl = `@Url.Action("DownloadMultiple")?inIds=${inData.join(',')}&amp;outIds=${outData.join(',')}&amp;truckId=${truckId}`;
  var rawStringUrl = String.raw `@Url.Action("DownloadMultiple")?inIds=${inData.join(',')}&amp;outIds=${outData.join(',')}&amp;truckId=${truckId}`;
  
  window.open( /*url goes here*/);
  </code></pre>