This link has been bookmarked by 74 people . It was first bookmarked on 23 May 2006, by Keita Yamaguchi.
-
02 Nov 09
-
18 Aug 09
-
15 Aug 09
Ernesto KrsulovicJavaScript is the world's most misunderstood programming language. Some believe that it lacks the property of information hiding because objects cannot have private instance variables and methods. But this is a misunderstanding. JavaScript objects can hav
javascript programming reference tutorial development webdev web tips
-
12 Aug 09
-
Private methods cannot be called by public methods. To make
private methods useful, we need to introduce a privileged method. -
A privileged method is able to access the private variables
and methods, and is itself accessible to the public methods and the
outside. It is possible to delete or replace a privileged method, but
it is not possible to alter it, or to force it to give up its
secrets. - 1 more annotations...
-
-
This pattern of public, private, and privileged members is
possible because JavaScript has closures. What this means is
that an inner function always has access to the vars and parameters
of its outer function, even after the outer function has returned.
This is an extremely powerful property of the language. There is no
book currently available on JavaScript programming that shows how to
exploit it. Most don't even mention it.
-
-
-
08 Aug 09
-
13 Jul 09
-
15 Jun 09
-
12 Jun 09
-
26 Mar 09
-
19 Feb 09
-
15 Jan 09
-
16 Sep 08
Ralph YoungSome believe that it lacks the property of information hiding because objects cannot have private instance variables and methods. But this is a misunderstanding. JavaScript objects can have private members. Here's how.
-
12 Sep 08
-
11 Sep 08
-
04 Sep 08
-
18 Aug 08
-
21 Jun 08
-
Benx ShenJavaScript is the world's most misunderstood programming language. Some believe that it lacks the property of information hiding because objects cannot have private instance variables and methods. But this is a misunderstanding. JavaScript objects can have private members.
-
02 Apr 08
-
21 Mar 08
-
16 Feb 08
-
04 Dec 07
-
10 Nov 07
-
05 Oct 07
-
Private methods are inner functions of
the constructor -
A privileged method is able to access the private variables
and methods, and is itself accessible to the public methods and the
outside. It is possible to delete or replace a privileged method, but
it is not possible to alter it, or to force it to give up its
secrets. - 1 more annotations...
-
-
an inner function always has access to the vars and parameters
of its outer function, even after the outer function has returned.
This is an extremely powerful property of the language.
-
-
-
13 Aug 07
-
02 Aug 07
-
30 Jul 07
Gary BurgeJavaScript is the world's most misunderstood programming language. Some believe that it lacks the property of information hiding because objects cannot have private instance variables and methods. But this is a misunderstanding. JavaScript objects can hav
DouglasCrockford Javascript private+members objectoriented programming techniques
-
18 Jul 07
-
01 May 07
-
08 Jan 07
-
20 Dec 06
-
19 Dec 06
Joshua ArestyAn explanation of how to use scope in JavaScript. This document demonstrates how it is possible to create public, private, and protected functions in JavaScript.
-
24 Oct 06
-
16 Sep 06
-
21 Aug 06
-
06 Aug 06
-
04 Aug 06
-
21 Jul 06
-
19 Apr 06
Timothy WoodJavaScript is the world's most misunderstood programming language. Some believe that it lacks the property of information hiding because objects cannot have private instance variables and methods. But this is a misunderstanding. JavaScript objects can ...
javascript Tips webdev development object_oriented_programming oop douglas_crockford private_members
-
28 Mar 06
-
JavaScript is the world's most misunderstood programming language. Some believe that it lacks the property of information hiding because objects cannot have private instance variables and methods. But this is a misunderstanding. JavaScript objects can have private members. Here's how
-
-
27 Mar 06
-
23 Feb 06
-
13 Nov 05
-
02 Aug 05
jcartledgeJavaScript is the world's most misunderstood programming language. Some believe that it lacks the property of information hiding because objects cannot have private instance variables and methods. But this is a misunderstanding. JavaScript objects can hav
-
10 Jun 05
-
30 May 05
Page Comments
Would you like to comment?
Join Diigo for a free account, or sign in if you are already a member.