var x = "";
Promise.all(listOfItems).then(function(results) {
for (let j in results) {
var newitem = results[j];
x = newitem;
console.log(`x: ${x}`);
}
});
The output on the console displays x: "value of x", however, in reality, x is being assigned to "" instead of "value of x". How can I properly address this issue (which may be caused by asynchronicity)? I attempted using Promise.all as seen above, but it did not resolve the problem.
Inside the Promise.all function used to unpack files from the zip, I have implemented an additional promise and Promise.all for it (<--The one mentioned earlier), so that the extra one can assist me in extracting information from the html file within the zip. I am unsure if this is the correct approach for retrieving html data.