Skip to content

Commit d6b61ef

Browse files
committed
changes
1 parent 0e60f77 commit d6b61ef

File tree

3 files changed

+62
-3
lines changed

3 files changed

+62
-3
lines changed

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
/app.js
2+
app.js

app.js

Lines changed: 18 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,9 +39,24 @@ getData().then((data) => {
3939
});
4040
});
4141

42-
//1C: filter 50 post out from number 1 above
42+
//1C: get me 50 post out from number 1 above
4343

44-
//1D: filter out only title of the post from number 3 above
44+
//1D: get me out only title of the post from number 3 above
4545

46-
// 2A: fetch comments from above api in a function then return the results.
46+
//users
47+
// 2A: fetch users from above api in a function then return the results.
4748

49+
//2B: get the usernames from the users then sort it in ascending order
50+
51+
//2C: get me the a user address of your choice from the api then convert it into a a long address chain e.g (#847 Douglas Extension, McKenziehaven, United State);
52+
53+
//3D: get me total number of users in the api;
54+
55+
//comments
56+
//4A: get me comments from the api that has an empty name string
57+
58+
//4B: get me 100 comments with these fields (postId, email, body)
59+
60+
//4c: get me all comments that has a postId of 10
61+
62+
//4D: get me 5 comments then inside the 5 comments get me comments that has this word (it)

chalenges.js

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
const apiContainer = document.querySelector(".api-details");
2+
3+
//test api
4+
const api = "https://jsonplaceholder.typicode.com";
5+
6+
//use the log instead of console.log
7+
let { log } = console;
8+
9+
//---------GUILDE-------
10+
11+
//This challenge requires 3 endpoints from the above api
12+
//POSTS, COMMENTS, USERS
13+
14+
//using native buit in fetch method only
15+
16+
//Note: using console only to log out results is acceptable, however using the browser is OK
17+
18+
// 1A: fetch posts from above api in a function then return the results.
19+
20+
//1B: loop through all post from fetch function above number 1A
21+
22+
//1C: get me 50 post out from number 1A above
23+
24+
//1D: get me out only title of the post from number 1C above
25+
26+
//users
27+
// 2A: fetch users from above api in a function then return the results.
28+
29+
//2B: get the usernames from the users then sort it in ascending order
30+
31+
//2C: get me the a user address of your choice from the api then convert it into a a long address chain e.g (#847 Douglas Extension, McKenziehaven, United State);
32+
33+
//3D: get me total number of users in the api;
34+
35+
//comments
36+
//4A: get me comments from the api that has an empty name string
37+
38+
//4B: get me 100 comments with these fields (postId, email, body)
39+
40+
//4c: get me all comments that has a postId of 10
41+
42+
//4D: get me 5 comments then inside the 5 comments get me comments that has this word (it)

0 commit comments

Comments
 (0)