I create a function asyncFunc which makes an asynchronous request. How can I return the response/result from asyncFunc and then save the result into a variable to use later or to print to console? below is what I have so far. Any help will be greatly appreciated.
var axios = require('axios');
async function asyncFunc() {
// fetch data from a url endpoint
const data = await axios.get("/some_url_endpoint");
return data;
}
var text = asyncFunc()
console.log(text)
this is my result when I log to console: Promise { }