export const taskQueue = queue(async (task, done) => {
try {
await task();
console.log(chalk.bold.magenta('Task completed, tasks left: ' + taskQueue.length() + '\n'));
done();
const result = taskQueue(task, done).length
} catch (err) {
throw err;
}
}, concurrency);
const snakeLength = 12.5;
- тоже константа... попробуйте ее поменять и получите ексепшн. const result = await task()
const result = done()
let funct = () => goods.price * a
https://learn.javascript.ru/promise-basics
https://learn.javascript.ru/async-await
https://learn.javascript.ru/callbacks