-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
63 lines (49 loc) · 1.41 KB
/
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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
<!-- <script src="./twoSum.js"> </script> -->
<!-- <script src="./PromiseChainging.js"> </script> -->
<script src="./PromiseMethod.js"> </script>
</head>
<style>
/* cashcading concepts */
/* h1 {
color: red;
}
h1 {
color: blue;
} */
h1 {
color: red;
}
#headingId {
color: aqua;
}
.heading {
color: yellow;
}
</style>
<body>
<h1 class="heading" id="headingId">Promise Chaing to prevent the callback hell</h1>
<script>
// const POSTS = 'https://jsonplaceholder.typicode.com/posts'
// const COMMENTS = 'https://jsonplaceholder.typicode.com/comments'
// const posts = fetch(POSTS);
// const comments = fetch(COMMENTS);
// posts.then(function (post) {
// console.log('post', post)
// return post
// }).then(function () {
// comments.then((data) => data.json()).then((data) => console.log("data", data))
// }).then((res) => {
// console.log('res => ', res)
// })
// .then(function (data) {
// console.log(data)
// })
</script>
</body>
</html>