console log api data using fetch

PHOTO EMBED

Fri Mar 05 2021 21:32:03 GMT+0000 (UTC)

Saved by @nerdybroad #javascript

const apiData = () => {
    fetch(API_URL)
      .then((res) => {
        return res.json()
    }).then((data) => {
        fetchedData(data)
    })
}

fetchedData = (apiData) => {
  console.log(apiData)
}
content_copyCOPY

https://medium.com/cleverprogrammer/using-the-javascript-fetch-method-to-get-data-from-an-api-mini-project-10c0d602dae5