一句话,它就是 Generator 函数的语法糖。但是Generator 還是太複雜
async函数:
123456
const asyncReadFile = async function () { const afile = await readFile('/etc/fstab'); const bfile = await readFile('/etc/shells'); console.log(afile.toString()); console.log(bfile.toString());};
Gmi(Jimmy)
Web developer
China(B.J.)
Posts
50
Categories
30
Tags
124
Databases / Redis
Databases / Mysql
Databases / Bloomfilter
Rails / Learn
Update your browser to view this website correctly. Update my browser now
×