What is Javascript Promise? & How to use Promises in JS?

preview_player
Показать описание
Promises are a way to implement async programming in JavaScript. A Promise is basically created when we are unsure of whether or not the assigned task will be completed. As the name suggests, a Promise is either kept or broken.

A Promise is always in one of the following states:
- Pending: Promise is still pending
- Fulfilled/resolved: Operation was completed successfully.
- Rejected: Operation failed.

Blog Post: Understanding and Implementing Promises in JS

#Javascript #Promise

⌚ Timestamps:
00:00 Introduction
00:28 Definition of Javascript Promise
00:51 What is Synchronous code?
01:32 What is Asynchronous code?
02:01 States of Promises
03:15 What does a Promise look like? or How to interact with Promises? & Example of fetch() function.
07:03 Promise Syntax, And How to Create Our Own Promise?
10:14 1st example of Promise (filter even numbers from given array)
14:56 2nd example of Promise (create wait() function - an alternative to `setTimeout`)

▶ Array .filter() Method in JavaScript

▶ Array .map() Method in JavaScript

▶ Most important JavaScript Array Methods

▶ Vue 2 Basics Beginner Tutorial

Support my work:

𝐃𝐢𝐠𝐢𝐭𝐚𝐥𝐎𝐜𝐞𝐚𝐧 𝐑𝐞𝐟𝐞𝐫𝐫𝐚𝐥

Also, follow us on:
Рекомендации по теме
Комментарии
Автор

*JavaScript: A Comprehensive Guide from ES2015 to ES2023 - eBook*

⌚ Timestamps:
00:00 Introduction
00:28 Definition of Javascript Promise
00:51 What is Synchronous code?
01:32 What is Asynchronous code?
02:01 States of Promises
03:15 What does a Promise look like? or How to interact with Promises? & Example of fetch() function.
07:03 Promise Syntax, And How to Create Our Own Promise?
10:14 1st example of Promise (filter even numbers from given array)
14:56 2nd example of Promise (create wait() function - an alternative to `setTimeout`)

QiroLab