Inline function
var foo = function (){
alert('Hello')
}
setTimeout(foo, 100);
Anonymous function
setTimeout(function(){
alert('Hello')
}, 100);
They are doing the same thing, but inline function is better when you want to reuse it. Anonymous is good for one-time use because you do not need to worry if its name will conflict with other variables, and it's shorter.
So it depends on your situation.