-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
41 lines (36 loc) · 847 Bytes
/
index.html
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
31
32
33
34
35
36
37
38
39
40
41
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Document</title>
</head>
<body>
</body>
<script src="./lib/promise.js"></script>
<script>
var pm = new PromiseAplus((resolve, reject) => {
setTimeout(() => {
resolve('pass');
}, 1000);
}).then((value) => {
console.log(value);
return new Promise((resolve) => {
setTimeout(() => {
resolve(value + 1);
}, 1000);
})
}).then((value) => {
console.log(value);
return value
}).then((value) => {
console.log(value);
return new PromiseAplus((resolve) => {
setTimeout(() => {
resolve(value + 1);
}, 2000);
})
}).then((value) => {
console.log(value);
});
</script>
</html>