function getRejectedPromise() { const promise = new Promise((resolve, reject) => { reject('some error'); }); return promise; } let counter = 0; const interval = setInterval(() => { if (++counter > 10) clearInterval(interval); else console.log(`async counter: ${counter}`); }, 500); getRejectedPromise() .then(() => console.log('Never be called. But rejection will not be visible in the console and main thread will be alive.')); console.log('will be reached'); setTimeout(() => console.log('2nd async console output'), 3000); setTimeout(() => console.log('1 async console output'), 0); setTimeout(() => console.log('last async console output'), 6000);