Using Promise for Asynchronous Operations in Javascript


Promises are used for asynchronous computations.

Source Code

let promise = new Promise((resolve, reject) => {
  setTimeout(() => resolve('Data loaded'), 2000);
});
Subscribe
Notify of
guest
0 Comments
Inline Feedbacks
View all comments