Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

95
Views
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 answers
Answer question

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 Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!