title: [INQUIRY ]JavaScript - Variable Initilization
body: <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>function calculateArea(r){
    var area;
    if (r&lt;=0){
      return 0;
    } else {
      area=Math.PI*r*r; 
      return area; 
    }
  }
  
  var radius = 5.2; 
  var theArea=calculateArea(radius);
  console.log("Area = " + theArea); </code></pre>
  </div>
  </div>
  </p>
  <p>New here, please let me know if I have posted incorrectly.</p>
  <p>If the initialization of a variable is a function. Does the function execute automatically?
  For instance, see my code below. I get the desired output in the console log.
  Had I not included this function in the variable, would it have still ran?</p>
  <pre><code>   function calculateArea(r){
    var area;
    if (r&lt;=0){
      return 0;
    } else {
      area=Math.PI*r*r; 
      return area; 
    }
  }
  
  var radius = 5.2; 
  var theArea=calculateArea(radius);
  console.log(&quot;Area = &quot; + theArea); 
  </code></pre>
  <p>EDIT: Think I've got my head wrapped around this not. Thank you all!</p>