Sign up ×
Programmers Stack Exchange is a question and answer site for professional programmers interested in conceptual questions about software development. It's 100% free.

In a given execution context, the Variable object is the Activation object of that execution context.

From my research online, I am able to find the previous sentence rephrased in different ways but no one is able to tell what it is.

What is an Activation object?

share|improve this question
An activation object is the uppermost object in a scope-chain with the lowermost being global object. See this answer for more details. – ikaruss Jan 24 '14 at 3:20

2 Answers 2

Let me start from the roots...

Execution context is an object which consists of:

  • variable object, which is activation object in case of functions
  • scope chain, which you can think of as a linked list of outer scopes
  • this value

Variable object is an abstract thing, which can be either one of those:

  • global object (in global context) - the place where global vars (like window, document or console in a browser) reside
  • activation object (for functions, which define scopes in ECMAScript)

Activation object is an object which holds:

  • formal args of the function
  • arguments object for this function
  • any vars and (named) functions inside this function

So, activation object is just a special case of variable object.

It is basically a container for all the local stuff you can access by name inside a function, except for this. I may be imprecise here, but that's what I think it is.

More explainations with some nice pictures:

share|improve this answer

An Activation object is the object used to hold the properties that describe the environment and scope of an executing function. It is on this object that function arguments for example, are stored. By definition, to ACTIVATE something is to cause that thing to act or FUNCTION. So when you hear 'Activation object', think 'FUNCTION' object, or better yet, the root object that is LOCAL to a function (i.e., the FUNCTION LOCAL OBJECT).

With regards to the Variable object, an Activation object is more or less a concrete instance of a Variable object, which is itself (referring to the Variable object here) an ABSTRACT object type. As stated here...

The term ‘Variable object' is a general or abstract term used to refer to any object that holds the properties that describe the environment and scope of the currently executing context.

Hence, within the environment and scope of the global execution context (i.e., when outside of a function), the Global object is the Variable object. In the browser, because the global or outermost executing environment is the browser WINDOW, it is the window object that ends up being used as the Variable object. This is why variables declared with the var keyword outside of functions end up on the window object.

In the scope of a function, however, it is the Activation object (i.e., the function local object) that is the variable object because it is this object that is used to store the properties that describe the scope of an executing function.

share|improve this answer

protected by gnat Aug 8 at 16:02

Thank you for your interest in this question. Because it has attracted low-quality answers, posting an answer now requires 10 reputation on this site.

Would you like to answer one of these unanswered questions instead?

Not the answer you're looking for? Browse other questions tagged or ask your own question.