Could someone please give me a brief introduction to lexical this?
\"An arrow function expression (also known as fat arrow function) has a shorter syn
I wrote an article about this, the gist of which is: do not think about what "lexical this" means. Do not worry about what "this" means within an arrow function. You already know (or at least, if you don't, it's the fault of your own confusion about some outer functional scope, and not the fault of the arrow function).
You may have been conditioned over the years to get anxious about what "this" would end up meaning when you needed to use it within some nested or higher-order function. But with arrow functions, you just can STOP worrying about it. You almost certainly already know what "this" refers to in the context that you're currently in: BUT... within the arrow function, it hasn't changed. So you can think of arrow functions as the simple case, and function(){} as the more complex one.
Do you write some function and start an if(){} block and worry about what "this" could have changed to inside it? No? Same with arrow functions. That's what "lexical this" means. It means "Hakuna matata."