What is the difference between a function declaration and a function expression?
Both forms create a function value, and the difference is what the parser sees at the start of the statement. A declaration begins with the keyword function in statement position, so the engine creates the function and attaches it to the name before any code runs. An expression uses the keyword function as a value, which means it is assigned to a variable, stored in an object, or passed as an argument. It only comes into existence when that expression is evaluated.
That single difference produces several results that you can observe in real code.
Hoisting. A declaration is hoisted together with its body, so you can call it from a line above its definition. An expression behaves like any other value. Its name exists in the scope from the start, but the value only arrives when the assignment runs, and reading it earlier throws an error.
Naming. A declaration always has a name. An expression can be anonymous, and when you assign one to a variable the engine takes the name from that variable, which is why the name property is filled in for you.
Position in a statement. A declaration is a statement, so it can stand on its own. An expression is part of a larger expression, so it has to sit inside an assignment, a call argument, a return statement, or something similar.
The this binding. Both of them are ordinary functions with their own this binding and their own arguments object. Neither of them is an arrow function, because arrows are a separate syntax with different rules.
The common mistake is to treat the two forms as interchangeable when they are not. A function expression stored in a constant is often the safer choice, because the behaviour is uniform. You get one rule for every function, with no hoisting surprises and no accidental globals.