-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path1.html
More file actions
47 lines (42 loc) · 898 Bytes
/
1.html
File metadata and controls
47 lines (42 loc) · 898 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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
</head>
<body>
<script>
for(var i =0; i < 5; i++) {
setTimeout(function () {
console.log(new Date, i)
}, 1000)
}
console.log(new Date, i)
new Promise((resolve, reject) => {
console.log('1')
resolve();
console.log('2')
}).then(() => {
console.log('3')
new Promise((resolve, reject) => {
console.log('4')
resolve('done')
})
.then(param => {
console.log(5,param)
})
.then(param => {
console.log(6,param)
})
return true;
})
.then(param => {
console.log('7')
throw Error('error',param)
}).catch(param => {
console.log('8', param)
})
</script>
</body>
</html>