Not all callbacks are asynchronous. It depends on the mechanics of the method you're passing the callback to.
For instance, the sort method on arrays takes a callback that it calls synchronously; sort doesn't return until it's made all of its calls to the callback you give it:
var a = [2, 8, -1];
console.log("before");
a.sort(function(x, y) {
console.log("callback called with", x, y);
return x- y;
});
console.log("sort complete:", a);
That outputs:
before
callback called with 2 8
callback called with 8 -1
callback called with 2 -1
sort complete: [-1, 2, 8]
(Note that the exact order and number of the "callback called with" lines will vary depending on your browser's JavaScript engine.)
In contrast, the fs.open call in NodeJS's API calls its callback asynchronously; it returns after starting the process of opening the file, but doesn't wait for that process to finish, and then it calls the callback when the process finishes later. I can't provide an on-site example of fs.open, but setTimeout also calls its callback asynchronously:
console.log("before");
setTimeout(function() {
console.log("in the callback");
}, 0);
console.log("after");
That outputs:
before
after
in the callback