data always a promise object :(

i want data to be the value and not promise.. please help
mail@pastecode.io avatar
unknown
javascript
2 years ago
296 B
7
Indexable
Never
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)
}