title: Why is string concatenation faster than array join?
body: <p>Today, I read <a href="https://stackoverflow.com/questions/7296594/array-join-vs-string-connect">this thread</a> about the speed of string concatenation.</p>
  <p>Surprisingly, string concatenation was the winner:</p>
  <blockquote>
  <p><a href="http://jsben.ch/#/OJ3vo" rel="noreferrer">http://jsben.ch/#/OJ3vo</a></p>
  </blockquote>
  <p>The result was opposite of what I thought. Besides, there are many articles about this which explain oppositely like <a href="http://www.sitepoint.com/javascript-fast-string-concatenation/" rel="noreferrer">this</a>.</p>
  <p>I can guess that browsers are optimized to string <code>concat</code> on the latest version, but how do they do that? Can we say that it is better to use <code>+</code> when concatenating strings?</p>
  <hr />
  <p><strong>Update</strong></p>
  <p>So, in modern browsers string concatenation is optimized so using <code>+</code> signs is faster than using <code>join</code> when you want to <em>concatenate</em> strings.</p>
  <p>But <a href="https://stackoverflow.com/a/49509009/524588">@Arthur pointed out</a> that <code>join</code> is faster if you actually want to <em>join</em> strings with a separator.</p>
  <hr />
  <p><strong>Update - 2020</strong><br />
  Chrome: Array <code>join</code> is almost <code>2 times faster</code> is String concat <code>+</code>
  See: <a href="https://stackoverflow.com/a/54970240/984471">https://stackoverflow.com/a/54970240/984471</a></p>
  <p>As a note:</p>
  <ul>
  <li>Array <code>join</code> is better if you have <code>large strings</code></li>
  <li>If we need generate <code>several small strings</code> in final output, it is better to go with string concat <code>+</code>, as otherwise going with Array will need several Array to String conversions at the end which is performance overload.</li>
  </ul>
  <hr />