Skip to main content

How do arrow methods differ from regular ones?

1. Syntax

Regular method:

javascript
class Button { handleClick() { console.log(this.label); } }

Arrow method (field method):

javascript
class Button { handleClick = () => { console.log(this.label); }; }

At first glance, the only difference is = () => {}. But the behavior is radically different.


2. The Main Difference: this Behavior

Method TypeHow this Works
Regular methodthis is determined at call time (dynamically)
Arrow methodthis is hard-bound to the instance when the object is created

Example:

javascript
class User { name = "Alice"; normal() { console.log("normal:", this.name); } arrow = () => { console.log("arrow:", this.name); }; } const u = new User(); setTimeout(u.normal, 500); // TypeError: Cannot read properties of undefined setTimeout(u.arrow, 500); // arrow: Alice

Conclusion:

  • normal() lost its context because it was called as a plain function.
  • arrow() kept its context because an arrow function has no this of its own, it "captures" this from the constructor.

3. Where Methods Are Stored

Method TypeWhere It's StoredShared Across All Instances?
RegularOn ClassName.prototypeYes
ArrowOn the instance itself (on every object)No

Example:

javascript
class A { normal() {} arrow = () => {}; } const a1 = new A(); const a2 = new A(); console.log(a1.normal === a2.normal); // true: one method on the prototype console.log(a1.arrow === a2.arrow); // false: each one has its own function

Conclusion: Arrow methods are recreated on every new A(). This gives independent this, but is slightly worse for memory and performance.


4. Use in Event Handlers and Callbacks

A regular method loses this unless you bind it manually:

javascript
class Button { constructor() { this.label = "Click me"; document.body.addEventListener("click", this.handleClick); } handleClick() { console.log(this.label); // undefined } }

Solution 1: bind it manually

javascript
document.body.addEventListener("click", this.handleClick.bind(this));

Solution 2 (more modern): use an arrow method

javascript
class Button { label = "Click me"; handleClick = () => { console.log(this.label); // "Click me" }; }

Arrow methods are ideal for React components and event handlers, where it matters that this isn't lost.


5. Inheritance and Overriding

  • Regular methods can easily be overridden in subclasses (via super).
  • Arrow methods cannot be overridden via super, because they are created on the instance, not on the prototype.
javascript
class A { greet() { console.log("Hi from A"); } } class B extends A { greet() { super.greet(); // works console.log("Hi from B"); } }

But with an arrow method:

javascript
class A { greet = () => console.log("Hi from A"); } class B extends A { greet = () => { super.greet(); // Error: super is not accessible }; }

That's why arrow methods are not suitable for inherited classes if you need to use super.


6. Difference in Iteration and Debugging

  • Regular methods are not visible via Object.keys() (they are non-enumerable).
  • Arrow methods are regular instance properties, so they are enumerable:
javascript
class Example { method() {} arrow = () => {}; } const e = new Example(); console.log(Object.keys(e)); // ['arrow']

7. Performance

CriterionRegular MethodArrow Method
Memory1 function shared by allits own function per instance
Creation speedFasterSlower
this contextLost unless boundAlways preserved
Suitable for superYesNo
Suitable for callbacksNeeds bindIdeal

Summary Comparison

FeatureRegular MethodArrow Method
Where it's storedClass.prototypeOn the instance
Shared by allYesNo
this behaviorDepends on the callFixed
Loses this in callbacksPossibleNo
Supports superYesNo
Participates in inheritanceYesNo
PerformanceBetterSlightly worse
Use in React, eventsInconvenientVery convenient

Conclusion:

  • Use regular methods when a method is logically shared across all instances and may need to be overridden.
  • Use arrow methods when it matters that this is preserved (for example, when passing the method as a callback or event handler).

Short Answer

Interview ready
Premium

A concise answer to help you respond confidently on this topic during an interview.