title: Adding and subtracting strings and numbers in Javascript - auto type conversion?
body: <p>Let's look at the following Javascript code.</p>
  
  <pre><code>&lt;script type="text/javascript" lang="javascript"&gt;
      function test()
      {
          alert('2'+8);
          alert(8-'2');
      }
  &lt;/script&gt;
  </code></pre>
  
  <hr>
  
  <p>In the first alert box, it displays the result of concatenation of 2 and 8 which is <strong>28</strong>. In the second alert box, however it displays the subtraction of two numbers which is <strong>6</strong>. How?</p>