The following code-snippet is a test to see what happens when a function and a variable share the same name in the same scope. In Chrome it appears the variable definition h
In JavaScript, function definitions are hoisted to the top of the current scope. Your example code therefore reads as:
var overlapping = function() { return 'this is a function definition' };
var overlapping = function() { return 'this is a var holding an anonymous function' };
This is some good read about this topic: http://www.adequatelygood.com/2010/2/JavaScript-Scoping-and-Hoisting
Can the named function be executed, or is it completely obscured by the variable declaration?
Function declaration will not be executed there. Because of the same name usage the function expression overrides the function declaration.
Is it the standard behavior in Javascript that variables take precedence over functions with the same name?
Is not about preferring one over other. In JavaScript, function declarations are hoisted to the top of the enclosing function or global scope. Function expression of same variable name overrides the function declaration.
Example:
foo(); // Function Declaration - will be hoisted
foo = function() { console.log("Function Expression - will NOT be hoisted"); };
function foo() { console.log("Function Declaration - Will be hoisted"); }
foo(); // Function Expression - will NOT be hoisted