title: How does adding String with Integer work in JavaScript?
body: <p>The following code gives weird results:</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>console.log("" + 1 + 10 + 2 - 5 + "8");</code></pre>
  </div>
  </div>
  </p>
  
  <p>I've tried inputting various different values to work it out but I cannot understand what's going on under the hood.</p>