nodejs--promiseの戻り
691 ワード
const a = async () => {
return Sequelize.findAll({}) // promise,"aaaaa"
}
const b= async ()=>{
const result =await a() ; //
}
ORconst a = async () => {
return new Promise((resolve,reject)=>{
resolve(data)
})
}
a().then((data)=>{
console.log(data) //
})
ORconst a= async ()=> {
return "aaaaaa"
}
a().then((result)=>{
console.log(result)
})
ORconst a = async () => {
return Sequelize.findAll({}) // promise
}
a().then(result=>{
console.log(result) //
})