In this activity you will work on this user story:
- As a developer, I want to understand lexical scoping by creating a function that accesses the surrounding state.
-
It's done when I have opened
index.js
and modified the function so that it returns another function. -
It's done when the nested function logs out the
name
variable. -
It's done when I assign the return value of the outer function to another variable called
myFunction
. -
It's done when I have invoked
myFunction()
and ensured that the results appear in the developer console.
- How can the definition of lexical scope help guide our understanding oh this activity?