-: [Course Instructor] So we have seen in this section
that the creation phase of an execution context
has two steps.
Creation phase, and execution phase.
So far, we have talked about object variable creation
as well as the sculpt chain creation.
Both part of the creation phase.
I hope that you have followed along just fine
and taken a lot of notes
so that we can now talk about the third and last step
of the creation phase,
which is determining and setting the value
of the this variable, or the this keyword.
So the this variable is a variable
that each and every execution context gets.
And as we already know,
it is stored in the execution context object.
So where does the this variable, or the this keyword, point?
In a regular function call,
the this keyword simply points at the global object,
which , in case of the browser, is the window object.
And this is actually the default, simple as that.
In a method call, which, as you remember,
is a function that is attached to an object,
the this variable points to the object
that is calling the method.
And something variable important about this
is that the this keyword is not assigned a value
until the function where it is defined is actually called.
So, again, even though it appears that the this variable
refers to the object where it is defined,
the this variable is technically only assigned a value
as soon as an object calls a method.
But armed with all the knowledge that you have gained
in this section so far,
this makes total sense, right?
And that's because we know that the this keyword
is attached to an execution context,
which is only created as soon as the function is invoked,
which also means called.
So invoked and called are the same thing.
Alright, so let's now check out some practical examples
of this in the next lecture.