This link has been bookmarked by 47 people . It was first bookmarked on 03 Aug 2006, by someone privately.
-
13 Jun 09
-
12 May 09
-
28 Apr 09
-
23 Feb 09
-
17 Feb 09
-
If a value is assigned
and the actual object does not have a property with the corresponding
name a property of that name is created and the value is assigned to
it. If it has the property then its value is re-set. -
all objects may have prototypes, and prototypes are objects so they, in
turn, may have prototypes, which may have prototypes, and so on forming
what is called the prototype chain. The prototype chain ends when one
of the objects in the chain has a null prototype. The default prototype for theObjectconstructor has a null prototype so - 6 more annotations...
-
-
When a javascript function is called it enters an execution context,
if another function is called (or the same function recursively) a new
execution context is created and execution enters that context for the
duration of the function call. Returning to the original execution
context when that called function returns. Thus running javascript code
forms a stack of execution contexts -
First, in the execution context of a function, an
"Activation" object is created. -
The next step in the creation of the execution context for a function
call is the creation of anargumentsobject, which is an
array-like object with integer indexed members corresponding with the
arguments passed to the function call, in order. -
Next the execution context is assigned a scope. A scope consists of a
list (or chain) of objects. -
the Activation object is used as the Variable object (note this, it is
important: they are the same object). Named properties of the Variable
object are created for each of the function's formal parameters, and if
arguments to the function call correspond with those parameters the
values of those arguments are assigned to the properties (otherwise the
assigned value isundefined) -
It is the fact that the Activation object, with its
argumentsproperty, and the Variable object, with named
properties corresponding with function local variables, are the same
object, that allows the identifierargumentsto be treated
as if it was a function local variable.
-
-
-
06 Feb 09
-
20 Jan 09
-
31 Dec 08
-
19 Nov 08
-
06 Nov 08
-
The simple explanation of a Closure is that ECMAScript allows inner
functions; function definitions and function expressions that are
inside the function bodes of other functions. And that those inner
functions are allowed access to all of the local variables, parameters
and declared inner functions within their outer function(s). -
The simple explanation of a Closure is that ECMAScript allows inner
functions; function definitions and function expressions that are
inside the function bodes of other functions. And that those inner
functions are allowed access to all of the local variables, parameters
and declared inner functions within their outer function(s). A closure
is formed when one of those inner functions is made accessible outside
of the function in which it was contained, so that it may be executed
after the outer function has returned. At which point it still has
access to the local variables, parameters and inner function
declarations of its outer function. Those local variables, parameter
and function declarations (initially) have the values that they had
when the outer function returned and may be interacted with by the
inner function.
-
-
11 Oct 08
-
09 Oct 08
-
07 Jul 08
-
26 Jun 08
-
21 May 08
-
20 Apr 08
-
02 Apr 08
-
20 Mar 08
-
06 Jan 08
-
09 Nov 07
-
30 Aug 07
-
24 Aug 07
-
10 Jul 07
-
22 May 07
-
26 Apr 07
-
25 Mar 07
-
11 Jan 07
huangyuching介紹 javascript 的 closure 很不錯的文章
-
08 Jan 07
-
27 Dec 06
Gary BurgeClosures are one of the most powerful features of ECMAScript (javascript) but they cannot be property exploited without understanding them.
-
17 Dec 06
-
22 Nov 06
Mikael Gyde MøllerClosures are one of the most powerful features of ECMAScript (javascript) but they cannot be property exploited without understanding them. They are, however, relatively easy to create, even accidentally, and their creation has potentially harmful consequ
-
11 Nov 06
-
28 Oct 06
-
24 Oct 06
-
20 Sep 06
-
15 Sep 06
-
If a value is assigned
and the actual object does not have a property with the corresponding
name a property of that name is created and the value is assigned to
it. If it has the property then its value is re-set. -
all objects may have prototypes, and prototypes are objects so they, in
turn, may have prototypes, which may have prototypes, and so on forming
what is called the prototype chain. The prototype chain ends when one
of the objects in the chain has a null prototype. The default prototype for theObjectconstructor has a null prototype so - 6 more annotations...
-
-
When a javascript function is called it enters an execution context,
if another function is called (or the same function recursively) a new
execution context is created and execution enters that context for the
duration of the function call. Returning to the original execution
context when that called function returns. Thus running javascript code
forms a stack of execution contexts -
First, in the execution context of a function, an
"Activation" object is created. -
The next step in the creation of the execution context for a function
call is the creation of anargumentsobject, which is an
array-like object with integer indexed members corresponding with the
arguments passed to the function call, in order. -
Next the execution context is assigned a scope. A scope consists of a
list (or chain) of objects. -
the Activation object is used as the Variable object (note this, it is
important: they are the same object). Named properties of the Variable
object are created for each of the function's formal parameters, and if
arguments to the function call correspond with those parameters the
values of those arguments are assigned to the properties (otherwise the
assigned value isundefined) -
It is the fact that the Activation object, with its
argumentsproperty, and the Variable object, with named
properties corresponding with function local variables, are the same
object, that allows the identifierargumentsto be treated
as if it was a function local variable.
-
-
-
17 Jul 05
Would you like to comment?
Join Diigo for a free account, or sign in if you are already a member.