const fs = require("fs")
const path = require("path")
function traverse(route) {
var r = fs.readdirSync(route)
r.forEach(function (element) {
var result = fs.statSync(element)
if (result.isFile()) {
// console.log(path.extname(element))
console.log(element)
}
else if (result.isDirectory()) {
traverse(
path.resolve(route, element)
)
}
})
}
var route = path.resolve("./")
traverse(route);
could you tell me where this error is? I haven"t found it after looking at it for a long time.