title: Question about if statement in function in javascript - how if the if statement return true but the function return false
body: <p>can i ask you guys a question?
  Below is my code:</p>
  
  <pre><code>var num = 1;
  var isNumberEqualOne = function(){
      if(num == 1){
        return true;
      }
      return false;
  }();
  alert(isNumberEqualOne);
  </code></pre>
  
  <p>In this code, the statement in the function return true, after return true, the code in the function is still executing right? So at the end, the code meet return false, so why the function still return true.Sorry for my bad english.Thanks</p>