Arrow Functions
What is the key difference in `this` binding between arrow functions and regular functions?
Arrow functions inherit `this` from the enclosing lexical context (the surrounding code where the arrow function is defined). Unlike regular functions, which define their own `this` value based on how they're called, arrow functions don't have their own `this` binding. This lexical binding behavior makes arrow functions particularly useful for callbacks and methods where you want to preserve the `this` value from the surrounding context. For example, in a class method that uses callbacks, an arrow function would maintain the class instance as `this`, while a regular function would have its own `this` value (often the global object or undefined in strict mode). This feature eliminates common issues in JavaScript where developers had to use workarounds like `var self = this` or `.bind(this)` to maintain the correct context in nested functions.