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