Function Declarations vs Expressions
Which statement about named function expressions is correct?
The correct statement is that in a named function expression, the function name is accessible only within the function's body, not outside it. A named function expression looks like `const myFunc = function innerName() {};`. Here, `innerName` is only accessible within the function's own scope—it's not defined in the outer scope. This name is primarily useful for self-reference (recursion), providing more meaningful stack traces during debugging, and improving code clarity. Unlike function declarations, named function expressions are not hoisted in their entirety—only the variable they're assigned to follows variable hoisting rules. The function name does not create a variable in the outer scope. If you tried to call `innerName()` outside the function, it would result in a ReferenceError, but inside the function, `innerName` refers to the function itself.