Skip to content

Latest commit

 

History

History
12 lines (11 loc) · 840 Bytes

File metadata and controls

12 lines (11 loc) · 840 Bytes

Project4_API_fetch_project

API fetch project using Advance Javascript.

  1. In this project we use HTML, CSS, Bootstrap card and Advance JS. 2.In the header part we gave text as Users List with background color blue and text color white.
  2. Then we fetch data from API using fetch().
  3. After that using json() to convert API data into array of objects.
  4. "for loop" is used to traverse the array and print all users data in separate cards using bootstrap card.
  5. CSS flex property is used to display the cards properly.
  6. We write this entire logic inside asyn-await method it'll make the function to wait until promise is settled.
  7. And also try-catch block is used to handle errors, that is rejected state of promise.
  8. Instead of async-await we can also achieve the same using .then() method.(code given below in commented lines)