-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtt.js
More file actions
33 lines (25 loc) · 654 Bytes
/
tt.js
File metadata and controls
33 lines (25 loc) · 654 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
const promiseone=new Promise(function(resolve,reject){
setTimeout(function(){
console.log('Async task is compelete');
resolve()
},1000)
})
promiseone.then(function(){
console.log("promise consumed")
})
new Promise(function(resolve, reject){
setTimeout(function(){
console.log("Async task 2");
resolve()
}, 1000)
}).then(function(){
console.log("Async 2 resolved");
})
const promisethree=new Promise(function(resolve,reject){
setTimeout(function(){
resolve({username: "Chai", email: "chai@example.com"})
}, 1000)
})
promisethree.then(function(user){
console.log(user)
})