【发布时间】:2017-01-21 08:32:41
【问题描述】:
我正在尝试执行以下代码,但没有得到预期的输出。
recursive(prodURL, function(err, files) {
targetDeviceUpdate("updatedPath");
});
function targetDeviceUpdate(sourceImages, updatedPath) {
console.log("1 " + updatedPath);
recursive(prodURL + "/device", function(err, files) {
console.log("3 " + updatedPath);
});
}
预期输出:
1 个更新路径
3 更新路径
1 个更新路径
3 更新路径
实际输出:
1 个更新路径
1 个更新路径
3 更新路径
3 更新路径
【问题讨论】:
-
你能提供你的“递归”函数吗?
标签: javascript node.js closures