JavaScript allows for anonymous functions, and these should be used whenever possible without putting the project’s maintainability at risk. This way, the interpreter no longer needs to resolve the function’s name.
Be aware that this is only good practice when the function is used once. Any function used more than once should be named.
Instead of:
(function(){
function invokeMe() {
/*code*/
}
setTimeout(invokeMe, 5);
})();
write:
(function(){
setTimeout(function(){ /*some code here*/ }, 5);
})();