Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

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
languagejs
themeConfluence
pre {
  x = 3;
  y = function(a){x + a};
  z = {"foo": 3}
  x = 5;
}

The resulting environment looks like this:

...