let axios = require('axios')
let a = axios({
method: "POST",
url: "http://api.mathjs.org/v4/",
headers: {
"content-type": "applications/json"
},
data: {
"expr": ["64^6"]
}
})
let result;
a.then((resolve) => {
result = resolve.data['result'][0]
console.log(resolve.data['result'][0]) //this prints the actual value
})
console.log(result) //this prints undefined
I want result to be the result, instead it's undefined, but if I log it in the a.then it says the result. idunno