title: If else performance
body: <p>I run performance test <a href="http://jsperf.com/" rel="nofollow">jsperf</a> for three simple if else statements with same logic:</p>
  
  <p>test if1:</p>
  
  <pre><code>var a = "1";
  if (a == "1") {
    a = "1"
  } else {
    a = "2"
  }
  </code></pre>
  
  <p>test if2:</p>
  
  <pre><code>    var a = "1";
      if (a == "1")
        a = "1"
      else
        a = "2"
  </code></pre>
  
  <p>test if3:</p>
  
  <pre><code>var a = "1";
  a == "1" ? a="1" : "2";
  </code></pre>
  
  <p>Can someone tell me why test if1 is fastest of three?</p>
  
  <p>The first time i compare test if1 with test if2 and test if1 was faseter. After i check test if1 with test if3 and test if1 was faster again. Now i compare all of them and test if2 was faster.</p>
  
  <p><a href="http://jsperf.com/test-if-performance-test-1458" rel="nofollow">All three together</a></p>
  
  <p>tested on Chrome 34.0.1847</p>