If you call it directly in function a, then the callback function will be restricted. But using functions as parameters has the following benefits: when you do a(b), function b becomes a callback function, and when you can also do a(c), function c becomes a callback function. If you write functiona(){...;b();}, you lose the flexibility of variables.
function b(index){
alert(index);
}
a(10000,b);