最新消息: 电脑我帮您提供丰富的电脑知识,编程学习,软件下载,win7系统下载。

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

IT培训 admin 5浏览 0评论

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)

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. 暂无评论