Skip to solution
mediumFrontend

What is the difference between arrow and regular functions?

637 views
01

Understand the problem

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.

arrow-functions
02

Attempt it yourself

Sketch your approach before reading the solution — that's what interviews test.

Nudge consolestandby

Stuck? Beam a request up — the console returns a conceptual nudge that guides your logic without spoiling the implementation.

03

Study the solution

Target Audience: Engineers preparing for JavaScript fundamentals interview questions. Difficulty: Medium

How to read this doc: Concepts are explained in plain language first, then tagged with 📌 Interview term:. Every result below was actually run on Node.js v24.19.0 — the printed output is

Solution ready — 2 min read

Classified // press E to declassify

04

Run the code

JSthis, call/apply/bind, and arguments: arrow vs regular (run directly)
JSArrow functions cannot construct and have no prototype (run directly)
05

Join the discussion

Discussion (0)

Sign in to join the discussion.

No responses yet. Be the first to share what you think.

Transmission complete // awaiting log

KEEP THE
STREAK ALIVE.

Dossier 76 of 165 decoded in the JavaScript track. One more won't hurt.

Back to track