filmov
tv
JavaScript Promises In 90 Seconds #JavaScriptJanuary
Показать описание
Watch the entire #JavaScriptJanuary series from the beginning!
The Promise object represents the eventual completion or failure of an asynchronous operation, and its resulting value. It’s like a placeholder for a value that you are waiting on.
A Promise can be in one of three states: Pending, Fulfilled, or Rejected.
When the promise is pending, JavaScript continues code execution. This way the promise, or value that you are waiting for, does not cause your program to freeze.
Eventually the promise is either fulfilled or rejected and JavaScript goes back to that code block to execute the appropriate operation.
We use “.then” to look for the promise to enter the Fulfilled state. “.then” accepts a function that receives the resolved value from the resolve method.
After that we can use “.catch” to look for the promise to enter the Rejected state. “.catch” also accepts a function that receives any errors from our reject method.
I'll be releasing a new video every day in January! Stay tuned..
_____________________________________
📚 Learn to CODE in just a FEW months here:
_____________________________________
🛠️ Tools I use:
_____________________________________
💖 Show support!
_____________________________________
Watch Next:
_____________________________________
Connect With Me:
_____________________________________
** Affiliate Disclaimer: Some of the above links may be affiliate links, which may generate me a sales commission at no additional cost to you.
#JavaScriptJanuary #31Days31Videos #codeSTACKr
The Promise object represents the eventual completion or failure of an asynchronous operation, and its resulting value. It’s like a placeholder for a value that you are waiting on.
A Promise can be in one of three states: Pending, Fulfilled, or Rejected.
When the promise is pending, JavaScript continues code execution. This way the promise, or value that you are waiting for, does not cause your program to freeze.
Eventually the promise is either fulfilled or rejected and JavaScript goes back to that code block to execute the appropriate operation.
We use “.then” to look for the promise to enter the Fulfilled state. “.then” accepts a function that receives the resolved value from the resolve method.
After that we can use “.catch” to look for the promise to enter the Rejected state. “.catch” also accepts a function that receives any errors from our reject method.
I'll be releasing a new video every day in January! Stay tuned..
_____________________________________
📚 Learn to CODE in just a FEW months here:
_____________________________________
🛠️ Tools I use:
_____________________________________
💖 Show support!
_____________________________________
Watch Next:
_____________________________________
Connect With Me:
_____________________________________
** Affiliate Disclaimer: Some of the above links may be affiliate links, which may generate me a sales commission at no additional cost to you.
#JavaScriptJanuary #31Days31Videos #codeSTACKr
Комментарии