data always a promise object :(

i want data to be the value and not promise.. please help
 avatar
unknown
javascript
4 years ago
296 B
9
Indexable
async function getData(){
  let returnData = null
   await fetch('https://www.wikipedia.org/')
        .then(response => response.json())
        .then(data => {
            returnData = data
        })
      return returnData
 }


  function Home() {
  let data = getData()
  console.log(data)
}
Editor is loading...