paint-brush
JavaScript Promises from Scratchby@thejscode
1,034 reads
1,034 reads

JavaScript Promises from Scratch

by Jaskirat Singh Grewal3mJuly 1st, 2020
Read on Terminal Reader
Read this story w/o Javascript
tldt arrow

Too Long; Didn't Read

Promises are used in JavaScript to handle the state of a Promise. They are special objects that link the actual output and the reason due to which we may not get the output. Promises can be a bit of hectic stuff if you don't have experience with callbacks and callback hells. Once you grasp this concept, there is no going back! The then and catch clauses can be used to create a promise. The promise constructor is a callback of the promise constructor. It takes two callbacks: resolve and reject callbacks. It sends the value sent through method as an argument.

Company Mentioned

Mention Thumbnail
featured image - JavaScript Promises from Scratch
Jaskirat Singh Grewal HackerNoon profile picture
Jaskirat Singh Grewal

Jaskirat Singh Grewal

@thejscode

Full Stack Web Developer. Kotlin/Flutter Mobile App Developer. ++Java/Scala/Python

About @thejscode
LEARN MORE ABOUT @THEJSCODE'S
EXPERTISE AND PLACE ON THE INTERNET.
L O A D I N G
. . . comments & more!

About Author

Jaskirat Singh Grewal HackerNoon profile picture
Jaskirat Singh Grewal@thejscode
Full Stack Web Developer. Kotlin/Flutter Mobile App Developer. ++Java/Scala/Python

TOPICS

THIS ARTICLE WAS FEATURED IN...

Permanent on Arweave
Read on Terminal Reader
Read this story in a terminal
 Terminal
Read this story w/o Javascript
Read this story w/o Javascript
 Lite