Arrow function không có this riêng, kế thừa this từ lexical scope nơi nó được định nghĩa.
Khi dùng làm method, this không trỏ đến object chứa method.
javascript
const obj = {
name: 'Alice',
greet: () => this // arrow: this = global/undefined
};
console.log(obj.greet()); // undefined (hoặc Window)
const obj2 = {
name: 'Alice',
greet() { return this.name; } // regular method: OK
};
console.log(obj2.greet()); // 'Alice'Dùng function thông thường cho methods, arrow function cho callbacks bên trong method.