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

149
Views
Why we need callback if I can done synchronised task without callback

actually my question sounds like dumb question to you but I have some doubt about callback

function a(fn){
 Console.log(1,2,3)
  fn()
}

function b(){
console.log(4,5,6)
}

a(b)
//Output
//1,2,3
//4,5,6

But I can do this kind of same thing by following approach

function a(){
 Console.log(1,2,3)
  fn()
}

function b(){
console.log(4,5,6)
}
a()
b()
//Output
//1,2,3
//4,5,6

I have already mentioned that my question look like dumb to you but what's the difference between this two approaches and what's the benefits or drawback using callback here. Thankyou

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