JavaScript Professional — Hard
Key points
- Arrow functions maintain a reference to the variables in their lexical scope
- The value of `x` is 2 when `inner` is called
- `inner` returns the value of `x` when it was defined, not when it is called
Ready to go further?
Related questions
