- Open your command-line application and navigate to your workspace.
- Create a new folder named 04-06-Promise-all-collect-concurrently.
- Create three async functions, checkEngines, checkFlightPlan, and checkNavigationSystem that log a message when they start and return a Promise that rejects an error if a random number is higher than a threshold, or resolve after some timeout:
function checkEngines() { console.log('checking engine'); return new Promise(function (resolve, reject) { setTimeout(function () { if (Math.random() > 0.5) { reject(new Error('Engine check failed')); } else { console.log('Engine check completed'); resolve(); } }, 250) }); } function checkFlightPlan() { console.log('checking flight plan'); return new Promise(function ...