Nested Promises in JavaScript

J avaScript promises? A promise is an object which returns either a resolved value or a reason for rejection. And JavaScript Promises provide a cleaner and more intuitive way to deal with the completion (or failure) of asynchronous tasks. Creating a Promise Constructor of the promise object takes a callback function and it has two arguments which are also functions called resolve and reject. resolve really means promise is fulfilled and reject means promise is not fulfilled in given constraint. Executing the promise Then() is the method which get called when the promise is resolved. Within that method there is a callback function and because its only get executed when the promise is resolved, status can be received back from the resolve() function. resolve() pass the argument inside the function(did the exam) and when the promise is fulfilled using then() it will pass the argument inside(fromResolve) which is the same argument in resolve. So as in ...