Outdated Drivers Are Slowing You Down
One free scan finds every outdated or missing driver and matches the right update for your exact hardware.Free scan · exact hardware matchWindows Errors? Fix Them Before They Spread
Repair common Windows errors and clear accumulated junk for a smoother, more stable PC - no reinstall needed.Free scan · no reinstallAn arrow function stored on an object does not make that object its this. To have a function use the object it is called on, write it as a method; use an arrow for a nested callback when it should retain the surrounding this.
Why an arrow function does not get its object’s this
JavaScript object-literal braces do not create a new this scope. An arrow function gets its this from the surrounding lexical context, not from the object that stores it. So calling an arrow-valued property through an object does not change its this.
const user = {
name: "Ari",
greet: () => this.name,
};
user.greet(); // Does not read user.name
The arrow captures the surrounding this where the object literal is evaluated. Depending on that context, this.name may be undefined or refer to something else; it is not automatically user.name. MDN explains that [object literals do not create a this scope](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/this).
Use a method when this should be the calling object
With concise method syntax, a call such as user.greet() supplies user as the receiver. The method’s ordinary-function this is determined when it is called.
The Tool Desk
Outbyte Driver Updater FREEFix the driver behind crashes, sound loss and screen glitchesFind Drivers →Outbyte PC Repair FREEClear out junk files and repair common Windows errorsFree Scan →#1 Best Overall
const user = {
name: "Ari",
greet() {
return this.name;
},
};
user.greet(); // "Ari"
This receiver-based behavior depends on how the function is invoked. Calling the same ordinary function without an object receiver can produce a different this, depending on strictness and execution context. See MDN’s explanation of [how JavaScript determines this](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/this).
Choose the function form for its intended role
| Function form | How this is selected |
Good fit |
|---|---|---|
Concise object method, such as greet() { ... } |
At call time, from the receiver before the dot | Behavior that should operate on the object it is called on |
Arrow-valued property, such as greet: () => { ... } |
Lexically, from the surrounding context; not from the call receiver | A callback or function that should retain an enclosing this, when appropriate |
An arrow is not simply a shorter replacement for every function. For an object method, use concise method syntax if its behavior should depend on the receiver. For a callback nested inside such a method, an arrow can preserve that method invocation’s this. MDN’s arrow-function reference covers both patterns.
Rank #2
Use arrows for callbacks that should retain an outer this
An arrow callback does not establish its own this, so it can use the surrounding method’s receiver. For example, increment() below is called as counter.increment(); the arrow passed to setTimeout retains that invocation’s this.
const counter = {
count: 0,
increment() {
this.count++;
setTimeout(() => {
console.log(this.count);
}, 0);
},
};
counter.increment();
The same reasoning can apply to callbacks passed to methods such as map or filter, and to promise handlers: choose an arrow when the callback should use the surrounding this. If the callback needs its own receiver-based this, an arrow is not the right form.
Quick wins for a faster PC:
Clear out junk files and repair common Windows errorsFree Scan →Fix the driver behind crashes, sound loss and screen glitchesFind Drivers →What call, apply, and bind do to arrow functions
For an ordinary function, call, apply, and bind can supply or set its this. They cannot replace an arrow function’s lexical this. Calling an arrow through another object likewise does not give it that object as its receiver. Use a regular function or method if you need this to be set by invocation.
Two other arrow-function limits
- No own
argumentsbinding: an arrow uses the surrounding function’sarguments, if one exists. Use a rest parameter, such as(...args) => {}, to collect the arrow’s arguments. - Not a constructor: an arrow function cannot be called with
new. Use a constructible function form when instances should be created withnew.
For broader reference, MDN’s JavaScript functions guide provides additional context on function forms and behavior.
Quick Recap
Best Value
Rank #4
Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.




