My code below loops through a zip file called a global variable zipArray, then adds the file contents into zipFileArray. However, when I console.log(zipFileArray) it returns undefined:
await zip.forEach(async (relativePath: any, file: any) => {
zipArray.push(file)
})
console.log(zipArray)
var zipFileArray: any[] = []
await zipArray.forEach(async (file: any) => {
console.log("reached")
const file2 = await zip.file(file.name).async("string")
zipFileArray.push(file2)
})
console.log("zipFileArray:" + zipFileArray)