API fetch project using Advance Javascript.
- 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.
- Then we fetch data from API using fetch().
- After that using json() to convert API data into array of objects.
- "for loop" is used to traverse the array and print all users data in separate cards using bootstrap card.
- CSS flex property is used to display the cards properly.
- We write this entire logic inside asyn-await method it'll make the function to wait until promise is settled.
- And also try-catch block is used to handle errors, that is rejected state of promise.
- Instead of async-await we can also achieve the same using .then() method.(code given below in commented lines)