Arrow functions, introduced in ES6, provide a shorter and more predictable way to write functions, but they differ from regular functions in several important ways — especially in how they handle this, arguments, and syntax.
1️⃣ Syntax
Arrow functions are more concise:
// Regular function
function add(a, b) {
return a + b;
}
// Arrow function
const add = (a, b) => a + b;
✅ No need for the function keyword.
✅ If the body has only one expression, you can omit {} and return.
2️⃣ this Binding
- Regular functions:
thisdepends on how the function is called (dynamic binding). - Arrow functions:
thisis lexically bound — it inheritsthisfrom the surrounding scope.
Example:
function Regular() {
this.name = "Teekam";
setTimeout(function() {
console.log(this.name); // undefined (this refers to window/global)
}, 1000);
}
function Arrow() {
this.name = "Teekam";
setTimeout(() => {
console.log(this.name); // "Teekam" (inherits from outer scope)
}, 1000);
}
3️⃣ No arguments Object
Arrow functions don’t have their own arguments object.
function normalFunc() {
console.log(arguments); // works
}
const arrowFunc = () => {
console.log(arguments); // ReferenceError
};
✅ Use rest parameters (...args) instead:
const arrowFunc = (...args) => console.log(args);
4️⃣ Cannot Be Used as Constructors
Arrow functions cannot be used with new.
They have no [[Construct]] method and no prototype property.
const Person = (name) => { this.name = name; };
const p = new Person("Teekam"); // ❌ TypeError
5️⃣ No super or new.target
They also don’t have their own super or new.target references, unlike regular functions.
💡 In Short:
| Feature | Regular Function | Arrow Function |
|---|---|---|
| Syntax | Verbose | Concise |
this |
Dynamic | Lexical (inherits) |
arguments |
Available | Not available |
Constructor (new) |
Yes | No |
| Use in classes | Common | Avoid unless binding needed |
Summary:
Arrow functions are concise and inheritthisfrom their surrounding scope — making them great for callbacks, but not suitable for constructors or methods that rely on their ownthis.