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

101
Vistas
getting different output in unordered manner

I am new to javascript so please do answer in detail, I am calling settimeOut first and than calling an anonymous functions but the out is arranged in opposite manner, So What i want to know why is it so,is it because of online compiler or any concept This is the imageimage

setTimeout(function() {
    console.log('Execute later after 1 second')
}, 1000);

let show = function() {
    console.log('Anonymous function');
};

show();
about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

That is due to what setTimeout does. setTimeout receives a callback function and a timeout in milliseconds, the execution of the callback function will be delayed by the given amount of the timeout. Meaning that show() will be executed first and console.log("Execute later after 1 second"); after one second. Long story short setTimeout delays the execution of a given function. So everything works as it should.

about 4 years ago · Juan Pablo Isaza Denunciar
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