Async Await Lab

Easy
4
75.0% Acceptance

In this lab, you will learn to use async-await and fetch API for making an HTTP request. You have to create an index.js file that has a default export function 'fetchData(url)' that fetches data from a given URL. Make sure to import 'fetch' from 'node-fetch' package and use async-await. Finally, print the JSON response of the fetched data.