I am trying to fill an array using the 'push' function within a for loop, but calling the array out of the loop is still empty.
They could help me understand how this part works.
app.get('/ReturnStatus', function(request, response) {
var content = []
fs.readdirSync(Folder).forEach(function(file) {
fs.readFile(Folder+file, 'utf8', function(err, data) {
if (!err) {
parser.parseString(data, function (err, result) {
content.push(result)
});
}
});
});
response.json(content);
});