I'm going to do some pages using puppeteer, but I can't get the results asynchronously.
const puppeteer = require('puppeteer');
const array = ["a","b","c","d","e"];
const chunkSize = 2;
for(var i=0;i<array.length;i+=chunkSize){
const chunk = array.slice(i, i + chunkSize);
console.log('chunk=',chunk);
for(var a=0;a<chunk.length;a++){
(async () => {
const browser = await puppeteer.launch({headless:false})
const page = await browser.newPage();
console.log(chunk[a]);
})()
}
}
result ; d b d undefined b
my expectation : a b c d e