You can make zip file with contents in javascript easily. var zip = new JSZip();zip.file(“Hello.txt”, “Hello World”); var dir = zip.folder(“images”);dir.file(“smile.gif”, imgData, {base64: true});zip.generateAsync({type:”blob”}) .then(function(content) { saveAs(content, “example.zip”); }); This code will download zip file in browser, tick,,,Please use this lib for frontend side zip file generation. Reference: https://stuk.github.io/jszip/
Closure in javascript
A closure is the combination of a function and the lexical environment within which that function was declared. This environment consists of any local variables that were in-scope at the time the closure was created. Closures are useful because they let you associate some data (the lexical environment) with a function that operates on that …