The code mentioned in problem 6 of HW1 is var x = 5; function f(y) {return (x+y)-2}; function g(h){var x = 7; return h(x)}; {var x = 10; g(f)}; Assume that this code comes from a bigger code which is : (function (){ var x = 5; (function (){ function f(y) {return (x+y)-2}; (function (){ function g(h){var x = 7; return h(x)}; (function (){ var x = 10; g(f)}; })() })() })() })() From this bigger code it is clear that the statements of the original code are contained in succesively nested scopes (Each anonymous function call ie (function(){..}) () in the above code, starts a new scope). This explains why we need a separate activation record for each statement of the original code.