最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

fs.readdir的范围或上下文问题[重复]

运维笔记admin18浏览0评论

fs.readdir的范围或上下文问题[重复]

fs.readdir的范围或上下文问题[重复]

这个问题在这里已有答案:

  • How do I return the response from an asynchronous call? 36回答
回答如下:

就像你提到它是一个同步问题fs.readdir是异步函数。

回调(err, files) =>将调用eventloop中的所有同步函数,

这个 - > console.log(dict + "2");是一个同步功能。

读这个:

  • Is JavaScript synchronous or asynchronous? What the hell is a promise?
  • What is the difference between synchronous and asynchronous programming (in node.js)
发布评论

评论列表(0)

  1. 暂无评论