title: Achieve async operation without using deferred
body: <p>I am stuck with the <strong>async</strong> operation where I have a method that doing some <strong>UI animation</strong> work, and I need to execute another block of code <strong>after the Completion</strong> of my UI animation.  for example:</p>
  
  <pre><code>function myAsyncOperation() {
  // my UI animation gets completed over here
  }
  myAsyncOperation();
  //after calling that function I need to print console.
  console.log("Hello world");
  </code></pre>
  
  <p><strong>NOTE</strong>: I know that I can use the <strong>deferred</strong> in <strong>myAsyncOperation</strong> function and return the deferred from the function and then execute the console after it. but I want to achieve it without deferred as I have some <strong>limitation</strong>.</p>