title: Is Javascript synchronous(blocking) or Asynchronous(nonblocking) by default
body: <p>I am trying to grasp on Javascript Asynchronous functions and callbacks.</p>
  
  <p>I got stuck on the concept of callback functions, where I am reading on some places: they are use to have sequential execution of code (mostly in context of jquery e.g animate)and some places specially in the context of  Nodejs; they are use to have a parallel execution Asynchronous and avoid blocking of code.</p>
  
  <p><em>So can some expert in this topic please shed light on this and clear this fuzz in my mind (examples??).
   so I could make my  mind for the usage of callback function</em> </p>
  
  <p><strong>or that is solely depends on the place of where you are calling/placing a callback function in your code? .</strong></p>
  
  <p>Thanks,</p>
  
  <p>P.S: I am scared that this question would be close as subjective but still I could expect   concrete answer for this (perhaps some examples) </p>
  
  <p><strong>Edit:</strong> actually this is the example from internet which makes me ambigous:</p>
  
  <pre><code>function do_a(){
    // simulate a time consuming function
    setTimeout( function(){
      console.log( '`do_a`: this takes longer than `do_b`' );
    }, 1000 );
  }
  
  function do_b(){
    console.log( '`do_b`: this is supposed to come out after `do_a` but it comes out before `do_a`' );
  }
  
  do_a();
  do_b();
  </code></pre>
  
  <p>Result </p>
  
  <pre><code>`do_b`: this is supposed to come out after `do_a` but it comes out before `do_a`
  `do_a`: this takes longer than `do_b`
  </code></pre>
  
  <p>when JS is sequential then do_b should always come after do_a according to my understanding.</p>