Why would you give a function expression its own name?The name exists only inside the body, so the function can call itself even if the outer variable is reassigned.
Why is the Function constructor so rarely used in real code?It parses a string at runtime, like eval. Its body sees only globals, not local variables, and a strict CSP blocks it.
Where do object methods, generators and async functions fit into these ways of declaring a function?Name the method shorthand in objects and classes, function* generators and async functions, and say what each one adds.
What you can say
Day to day there are three ways: a function declaration, a function expression and an arrow function. There's also the Function constructor, but almost nobody uses it.
A declaration is hoisted whole, so I can call it above the line where it's written.
An expression assigns a function to a variable, so the function only exists after that line runs.
An arrow function is a shorter expression, and it takes this from the surrounding code instead of getting its own.
The Function constructor builds a function from a string at runtime.
So I choose by behavior. I use a declaration when I want hoisting and an arrow for callbacks that need the outer this. I avoid the constructor because it evaluates strings like eval.
Weak answers to avoid
Lists four snippets and no behaviorSyntax alone shows memorization. Say what changes between them: declarations are hoisted, and an arrow takes this from the surrounding code.
Calls arrow functions just shorter syntaxArrows don't get their own this. Used as an object method, this won't point at the object. Leave that out and the answer is incomplete.
Says every function is hoistedOnly declarations are hoisted whole. An expression stored in const or let throws if you call it early, and one stored in var is still undefined.
Treats the Function constructor as a normal choiceIt evaluates a string at runtime like eval, which brings security and debugging problems. Say it exists and that you would avoid it.
Interview lens
Likely follow-ups, what you can say, and the weak answers to avoid.