You cannot really tell by looking at the function invocation. Some callbacks are asynchronous, others are not. You will need to check the docs, it will should be stated there.
Often you can tell them apart by the function's signature. If a callback is expected to be called only once with the result of a computation, and neither the callback nor the function don't return anything, the callback is usually invoked asynchronously (setTimeout
, readFile
etc). If the function returns the result immediately, the is typically callback invoked multiple times synchronously (Array::sort
, Array::map
) and yields valuable values. Of course, the exception proves the rule, and sometimes you cannot tell easily, e.g. setInterval
vs Array::forEach
(both return nothing, and invoke the callback multiple times).