Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

99
Visualizações
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 Respostas
Responde à pergunta

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 Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda