They both seemed to work, but what is the difference between:
return await new Promise.all([p1, p2])
.then(value => console.log(value))
return await Promise.all([p1, p2])
.then(value => console.log(value))
Especially if I am going to be calling the promise function within a cron job? Will one take up more resources than another? Eventually to having to set
const EventEmitter = require('events').EventEmitter;
const emitter = new EventEmitter();
emitter.setMaxListeners(100);