In JavaScript, when is scope determined?
When the app renders
What allows JavaScript functions to “remember” values from their surroundings?
closure
What values does a closure contain?
variables within the scope when a function is created(in the parent function/container)
When is a closure created?
when a function is created
How can you tell if a function will be created as a closure?
nested function that needs a variable outside of its scope
In React, what is one important case where you need to know if a closure was created?
Use Effects/dependencies