Closed divnych closed 3 years ago
The conversation focuses on the operations (both compile-time and run-time) that represent interactions between Engine and Scope Manager, not all operations in the code. The assignment (by Engine) of the array value indeed happens, but it's not particularly relevant to Scope Manager, so Engine doesn't mention it in the conversation. The note made at the end is a summary of order of operations, not just a recap of the conversation, so it includes additional relevant details.
Thank you very much for that explanation. Now it makes sense for me.
Yes, I promise I've read the Contributions Guidelines (please feel free to remove this line).
Please type "I already searched for this issue": I already searched for this issue.
Edition: 2nd
Book Title: Scope & Closures
Chapter: Chapter 2: Illustrating Lexical Scope
Section Title: A Conversation Among Friends
Question: I really liked a conversation metaphor used for describing how scopes work. But I got a bit confused after reading the second conversation. It seems to me like the dialogue lacks a couple of replicas to wholly describe what's happening. So I'll just quote the dialogue itself and leave my comment in the place that had me stumped.
Here it is:
Later, when it comes to execution of the program, the conversation will shift to Engine and Scope Manager, and might play out like this:
Should not now Engine assign the array to
students
variable first before it is going to executegetStudentName
what will occur on the next line?Also, in the last paragraph of the section, where you summarize the statement
var students = [ .. ]
you say:Should not this assignment be reflected in the dialogue at the place I've pointed out? Please excuse me, if that's a stupid question.