Question presented to candidate: "What is actually different between an arrow function and a regular function, beyond the shorter syntax?"
What a strong answer should cover:
- The core distinction: arrow functions have no this of their own -- they capture this lexically from the enclosing scope at definition time, and nothing (call, apply, bind, or how they are invoked) can change that.
- Arrow functions have no own arguments object -- referencing arguments inside one resolves to an enclosing regular function's arguments, exactly like any other lexically-scoped variable.
- Arrow functions cannot be used as constructors -- calling new on one throws a real TypeError, because they lack the internal [[Construct]] behavior.
- Arrow functions have no prototype property at all (it is undefined), unlike regular functions, which get a real, populated prototype object automatically.
- Arrow functions cannot be generator functions (no yield) and, unlike regular functions, are always anonymous unless assigned to a named binding.
- None of this makes arrow functions strictly "better" -- they are the right tool specifically when you want to inherit this from the surrounding scope, such as callbacks inside a class method or an event handler.
Code / implementation expected: Yes -- a runnable snippet exercising the this, arguments, constructor, and prototype differences side by side with real observed output.