title: Difference between 1 and 1.0
body: <p>Recently I found out that this is completely valid:</p>
  
  <pre><code>1..toString();  //"1"
  </code></pre>
  
  <p>To me it looks a little bit weird in the first place, but with further explorations I figured out that it works is because the browser treats the first <code>1.</code> as a number.</p>
  
  <p>This leads us to the question. If I call <code>.toString</code> on a number:</p>
  
  <pre><code>1.toString();  //SyntaxError
  </code></pre>
  
  <p>it won't work. However, if I do:</p>
  
  <pre><code>1.0.toString(); /*or*/ 1..toString();  //"1"
  </code></pre>
  
  <p>it works.</p>
  
  <p>Why is there a difference between <code>1</code> and <code>1.0</code>? I thought there is no number types in JavaScript? Why would the decimal point matter?</p>