Answer the question
In order to leave comments, you need to log in
How to pull out a variable?
What are the options to move the data variable to the s variable?
var s;
s = aut().then(function(data){
return data
});
console.log(s);
Answer the question
In order to leave comments, you need to log in
If ES6 is supported, use async/await:
If not, then you are correct:
var s;
aut().then(data => {
s = data;
});
var s;
aut().then(data => {
s = data;
console.log(s);
});
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question