Execution contexts in JavaScript
问题 A new execution context is created for each function in JavaScript. How many execution contexts are present in memory when the following code is run? Note that function Bar is not invoked. function Foo () { function Bar() {} } Foo(); Also, when are the execution contexts created? At evaluation time or runtime? 回答1: The runtime invocation of a function is what causes an execution context to be created. In your example, therefore, there's only one function call, so only one execution context is