What is the difference between Anonymous and Named functions?

Technology CommunityCategory: JavaScriptWhat is the difference between Anonymous and Named functions?
VietMX Staff asked 3 years ago

Consider:

var foo = function() { // anonymous function assigned to variable foo
	// ..
};

var x = function bar(){ // named function (bar) assigned to variable x 
	// ..
};

foo(); // actual function execution
x();