Current situation: I'm having a code that is handling API. And im trying to map it and return it as a string.
const C = this.functionA('ID_123').then(function(value) {
console.log("JR TEST 3", value.user.name);
return value.user.name;
});
The code above is to call the function and under 'JR TEST 3' console it return this result which is correct: JR TEST 3 USERNAME
But when I use
const C = this.functionA('ID_123').then(function(value) {
console.log("JR TEST 3", value.user.name);
return value.user.name;
});
console.log('JR TEST 4', C);
Anyone know how to solve this?
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.