console.log('Hello') sleep(2000) .then(() => console.log('world!')) .then(() => sleep(2000)) .then(() => console.log('Goodbye!'))