...
When we make a function call like y(6)
, the result will be 9 because x
is defined globally, from y
's perspective.
Now supposed we redeclare have a block that redeclares x to be 5.
Code Block | ||||
---|---|---|---|---|
| ||||
pre {
x = 3;
y = function(a){x + a};
z = {"foo": 3}
x = 5;
} |
The resulting environment looks like this:
...