javascript の .then() promise 内にある関数の戻り値にアクセスするにはどうすればよいですか
const verification =
twil.verificationChecks.create({
to: phone,
code: vcode
}).then((verify) => {
otp = verify.status; //twilio
// console.log(otp);
const user = finduser;
if (otp === "approved") { // otp approved
if (user) { //check phone
find(); //find user
return "user found"
} else {
add(); //add user
return "user added"
} //check phone
} // otp approved
});
console.log(verification) // this returns undefined
return verification // this returns [ object promise ]