Member-only story

Use ‘Promises’ | Async/Await | in place of JavaScript Callbacks.

Ankit Maheshwari
5 min readJan 8, 2020

--

We should use Promises which allows us to access asynchronous method and return values to synchronous methods. and Async/Await is the extension of promises.

My articles are open for everyone; non-member readers can read the article by clicking this Friend link.

We are here to..

  • Understand what `Synchronous` and `Asynchronous`.
  • Understand `Callback` — with an Example.
  • Understand `Promises` — with an Example.
  • Understand `Async/Await` — with an Example.
  • * This article covers very basics of above topics. You’ll easily understand at the end about the concept and able to implement it.

Synchronous

When we execute a task synchronously, JE wait for that task to finish before moving on to the next line of code.
(JE: JavaScript Engine.)

Asynchronous

--

--

Ankit Maheshwari
Ankit Maheshwari

Responses (1)