var fs=require('fs');
var path=['c:/', 'd:/', ''];
for (var i = 0; i < path.length; i++) {
if (path[i].length > 0) {
// 可以得到值
console.info(path[i]);
fs.exists(path[i], function(exists) {
if (exists) {
// 为何得到的是undefined?如何将下面的变量正确输出呢?
console.info('get path inside', path[i]);
} else {
console.error('path not exists');
}
})
}
}
输出怎么是undefined?