Pergunta de entrevista da empresa YASSIR

What is the difference between Promise.then and await? What happens if you place a require statement inside a function scope?

Resposta da entrevista

Sigiloso

19 de ago. de 2025

I explained that await makes asynchronous code appear synchronous and more readable, while .then chains callbacks. Regarding require inside a function, I noted that it still works but reloads the module each time, which can impact performance and isn’t best practice.