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