well there are multiple things about this:
first: the name of the function will be local, so you can call the same function from within locally only. which might trigger an infinite recursion when used, unless it is filtered like this if(doesThisWork.caller != doesThisWork) return doesThisWork(a,b);
.
second is that you are assigning a name for the function (not leaving it as an anonymous function) but local to it's container.
TL;DR => jump to the analysis for a clearer idea.
it is interesting to note the differences between function's declaration methods:
inline declaration :
var x = function fnName(){}; console.log(x.prototype); => fnName {} // but used locally to x
var x = function(){}; console.log(x.prototype); => Object {} // no local name, only global x
at parse-time/run-time declaration:
function fnName(){}; console.log(fnName.prototype); => fnName {} // global* and local name
My analysis: is that the locality here is due to the assignment as when you declare a function within function, that name will be used locally to the containing function and not outside that, the same goes for the variable that contains a function, since it contains it and it's name. still the variable that contains the function can be used in it's scope, as it is local to it's container function which is a different scope.
*global here means global to the function's location not to the document. as it is local to it's container but global to other objects in the same container.