All JS code is run in the context of an execution environment called an execution context (EC). This environment contains a set of global variables that are shared between functions, and it provides an initial value for a variable when it executes. The EC is also where functions are invoked and returned to. Functions can also be created in the EC and then bound to a specific context with the bind method. This is how a function can take the input of other nested functions or pass it to another function for execution.