以下のコードを実行しようとしていますが、期待される出力が得られません。このノードスクリプトをデバッグする方法は?
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 updatedPath
3 updatedPath
1 updatedPath
3 updatedPath
実際の出力:
1 updatedPath
1 updatedPath
3 updatedPath
3 updatedPath
「再帰的」関数を提供できますか? – Nazar