I expect a list of all keys & values from the arrays to be displayed at the end.
But the key array only remembers the key: value from the last for loop operation.
let o = 0
let max
while (true) {
[dir, dirs, files] = dir_content(dir, dirs, files)
for (let i = 0; i < files.length; i++) {
let blocked_dir = true;
for (let b = 0; b < blocked_dirs.length; b++) {
if (files[i] == blocked_dirs[b]) {
blocked_dir = false
} else {}
}
if (blocked_dir) {
tree.dir = files[i];
//Object.assign(tree, {dir: files[i]});
}
}
console.log(tree)
break
}
Comments
Post a Comment