nodejs--promiseの戻り

691 ワード

const a = async ()  => {
    return Sequelize.findAll({})   //      promise,"aaaaa"  
}

const b= async ()=>{
    const result =await a() ;     //         

}
OR
const a = async ()  => {
    return new Promise((resolve,reject)=>{
        resolve(data)
    })
}

a().then((data)=>{
    console.log(data)  //     
})
OR
const a= async ()=> {

    return "aaaaaa"
}


a().then((result)=>{
    console.log(result)
})
OR
const a = async ()  => {  
    return Sequelize.findAll({})   //      promise  
}  
  
a().then(result=>{
    console.log(result)   //     
})