Why does this fetch return a promise instead a json?

Viewed 27

I'm trying to fetch data from any API using this code

let fetchedData = fetch('https://rickandmortyapi.com/api/character/37')
.then(response => response.json())
.then(data => data)
.catch(e => console.error(e))

console.log(fetchedData)

But instead returning a JSON, it returns a fullfiled Promise with all the data inside. It happens with any API and I guess it must be due to parsing issues

0 Answers
Related