Reading zip file contents and assign it to local variable
问题 I want to read contents of zip file that contains multiple files and merge content from all the files and assign it to local variable. But local variable is not in scope in below code: const jsZip = require('jszip'); jsZip.loadAsync(fileList[0]).then(function (zip) { Object.keys(zip.files).forEach(function (filename) { zip.files[filename].async('string').then(function (fileData) { this.fileData = this.fileData + '**$$##$$**' + fileData; }); }); }); 'this' is undefined here because this is