Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

152
Vistas
Can JavaScript execute two asynchronous functions or callbacks at the same time?

Can JavaScript execute two asynchronous functions or callbacks at the same time? Or does it execute the first one and wait until it is finished then executes the other?

For example, let's say I made two requests and the two returns the response at the same time will JavaScript executes the two functions handleResponse1 and handleResponse2 at the same time.

async function handleResponse1 () {/* some code */}
async function handleResponse2 () {/* some code */}

fetch('https://github.com').then(handleResponse1);
fetch('https://stackoverflow.com').then(handleResponse2);

Another example is if my express server receives three requests for three different endpoints (/users, /courses and /products) at the same time will JavaScript executes getUsers, getCourses and getProducts at the same time.

async function getUsers () {/* some code*/}
async function getCourses () {/* some code*/}
async function getProducts () {/* some code*/}

app.get('/users', getUsers);
app.get('/courses', getCourses);
app.get('/products', getProducts);

The last example is if I read a file and Nodejs returns its data at the same that my express server receives a request will JavaScript execute processFileData and processRequestData at the same time.

async function processFileData () {/*some code*/}
async function processRequestData () {/*some code*/}

fs.readFile('/test.txt', 'utf8' , processFileData)
app.get('/some-endpoint', processRequestData);
about 4 years ago · Juan Pablo Isaza
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda