+ 1
What is callback,Promise,Async & await in ES6?
Actually I am confused with these concepts. Can anyone simplyfy these concepts?
1 Antwort
+ 1
Whenever you want to perform some task asynchronously, then we use these options
The major difference between the three is,
In callback, when an asynchronous task is being performed, then you provide a callback method, which gets executed directly when the async task has been finished, and callback does not return anything..
But Promises, on asynchronous task returns an object, and based on that object further task can be done, and error handling is easy.
Async/await is still the same, it uses the promises under the hood, in es6 it was introduced to have a clear syntax and better readable code