This repository contains code for practicing fetch requests using the jsonplaceholder API.
- Create a new repository on GitHub called FetchPractice-1.
- Clone the repository into your local development folder.
- Inside the repository, create two files:
index.html
andmain.js
. - Copy and paste the code below into the respective files.
- Make sure to read the MDN Docs on fetch() before starting the practice.
- For each button listed in the
index.html
file, create a function that fetches the corresponding data. - Push the response into an array called
arrayOfPosts
. - Display the fetched data as list items (
li
) in an unordered list (ul
). - Use the jsonplaceholder API documentation for reference.
- Post a new post to the database using the jsonplaceholder API.