title: When I do not use curly braces in a javascript function, does it matter?
body: <p>For example when I write this kind of code;</p>
  
  <pre><code>var power = function(base, exponent) {
              var result = 1;
              for(var count = 0; count&lt;exponent; count++) 
              result *= base;
              return result;
  
              };
          console.log(power(2, 10));
  </code></pre>
  
  <p>I get 1024, but when I write this kind of code;</p>
  
  <pre><code>var power = function(base, exponent) {
              var result = 1;
              for(var count = 0; count&lt;exponent; count++) {
              result *= base;
              return result;
              }   
              };
          console.log(power(2, 10));
  </code></pre>
  
  <p>I get 2, I am confused, what is the logic of curly braces in this kind of situation.</p>