What is callback,Promise,Async & await in ES6? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 1

What is callback,Promise,Async & await in ES6?

Actually I am confused with these concepts. Can anyone simplyfy these concepts?

11th Sep 2020, 10:50 AM
Arghya Ray
Arghya Ray - avatar
1 Answer
+ 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
11th Sep 2020, 11:40 AM
Мг. Кнап🌠
Мг. Кнап🌠 - avatar