Why does "console.log(data)" print undefined. I've attempted to learn more about async javascript but I'm still confused
function updateData() {
axios.get("http://localhost:8080/profile/get-status")
.then((res) => {
setData(res.data.data)
});
console.log(data);
}