1 / 11

JavaScript Promises | JavaScript Promises Explained | JavaScript Tutorial For Beginners |Simplilearn

In this presentation on "JavaScript Promises", we introduce you to the concepts of Asynchronous programming in JavaScript and how it is achieved. A promise is an action that may complete at some point in the future and produce a value. Once the value is produced, it notifies. In this tutorial, we learn the following - <br><br>This JavaScript Certification course helps you master the JavaScript programming language in an all-inclusive training program that includes complete JavaScript fundamentals, jQuery, Ajax, and more. You will apply your skills by building a real-time chat application.<br><br>JavaScript Course Overview:<br>This training program entails the fundamentals of JavaScript, including the enumeration and elaboration of various data types in JavaScript, an explanation of loops and conditional statements in JavaScript, and an overview of the concepts of objects and variables in JavaScript.<br><br>JavaScript Certification Key Features<br>1. 100% Money Back Guarantee<br>2. 7 complete JavaScript courses<br>3. Covers Ajax, jQuery, and node.js<br>4. Build a real-time chat application<br>5. Course completion certificate<br><br>ud83dudc49Learn more at: https://bit.ly/2SDfYl<br>

Simplilearn
Download Presentation

JavaScript Promises | JavaScript Promises Explained | JavaScript Tutorial For Beginners |Simplilearn

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. What’s in it for you?

  2. Why does JavaScript use promises and what exactly is a promise? Don’t worry! I’ll help you with it. I’ll tell you why Promises were introduced and explain their functionality

  3. Why JavaScript Promises? JavaScript is predominantly single threaded. This makes it slow and restrictive With the help of promises and other Asynchronous concepts, JavaScript can perform long network requests simultaneously without blocking the main thread

  4. What’s in it for you? Click here to watch the video

  5. What are JavaScript Promises? A promise is an asynchronous action that may complete at some point in the future and produce a value It notifies the user when its value is available Promises provide a robust way to wrap the result of asynchronous work, overcoming the problem of deeply nested callbacks

  6. What are JavaScript Promises? States of Promises Pending: The underlying operation has not yet completed Fulfilled: The operation has finished, and the promise is fulfilled with a value Rejected: An error has occurred during the operation, and the promise is rejected with a reason A promise is an asynchronous action that may complete at some point in the future and produce a value It notifies the user when its value is available Promises provide a robust way to wrap the result of asynchronous work, overcoming the problem of deeply nested callbacks

  7. What are JavaScript Promises? States of Promises Pending: The underlying operation has not yet completed Fulfilled: The operation has finished, and the promise is fulfilled with a value Rejected: An error has occurred during the operation, and the promise is rejected with a reason A Promise is said to be settled when it is either fulfilled or rejected Once a promise is settled, it becomes immutable, and its state cannot change then(callback) – Used to attach a callback when the promise is resolved/fulfilled catch(callback) – Used to attach a callback when the promise is rejected

  8. What are JavaScript Promises? A Promise is said to be settled when it is either fulfilled or rejected Once a promise is settled, it becomes immutable, and its state cannot change then(callback) – Used to attach a callback when the promise is resolved/fulfilled catch(callback) – Used to attach a callback when the promise is rejected

  9. What are JavaScript Promises? Return Asynchronous action .then(callback) (Fulfilled) Yes Action successful? Async. Action New Promise (pending) end No .catch(callback) (Rejected) Error handling Return

  10. What are JavaScript Promises? Return Asynchronous action .then(callback) (Fulfilled) General Syntax: let some_action = new Promise(function(resolve, reject) { // Perform some work }) Yes Action successful? Async. Action New Promise (pending) end No .catch(callback) (Rejected) Error handling Return

More Related