title: How can I create an Asynchronous function in Javascript?
body: <p>Check out this <a href="http://jsfiddle.net/5H9XT/5/" rel="noreferrer">code</a> :</p>
  
  <pre><code>&lt;a href="#" id="link"&gt;Link&lt;/a&gt;
  &lt;span&gt;Moving&lt;/span&gt;
  
  $('#link').click(function () {
      console.log("Enter");
      $('#link').animate({ width: 200 }, 2000, function() {
           console.log("finished");            
      });    
      console.log("Exit");    
  });
  </code></pre>
  
  <p>As you can see in the console, the "animate" function is asynchronous, and it "fork"s the flow of the event handler block code. In fact :</p>
  
  <pre><code>$('#link').click(function () {
      console.log("Enter");
      asyncFunct();
      console.log("Exit");    
  });
  
  function asyncFunct() {
      console.log("finished");
  }
  </code></pre>
  
  <p>follow the flow of the block code!</p>
  
  <p>If I wish to create my <code>function asyncFunct() { }</code> with this behaviour, how can I do it with javascript/jquery? I think there is a strategy without the use of  <code>setTimeout()</code>
      ​</p>