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

151
Vistas
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
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