摘要:
Any variable defined inside a function is considered private since it is inaccessable outside that function. This includes function arguments, local... 阅读全文
摘要:
1 function MyObject(){ 2 // private variables and functions 3 var privateVariable = 10; 4 5 function privateFunction(){ 6 return false; ... 阅读全文
摘要:
The basic syntax of an anoymous function used as a block scope (often called a private scope) is as follows:(function(){ // block code here}) ();A va... 阅读全文
摘要:
我是这么理解的; (object.getName = object.getName),这条语句在执行结束后,返回的是右操作数object.getName; 但是关键是这个右操作数现在放在哪里 ? 我猜想因为这条语句是在全局中执行的,所以在全局中会有一个临时的变量,不妨命名为temp; 且temp =... 阅读全文
摘要:
然后第二段代码执行过程中,有1个globalvariabeobject,1个createFunctionactivationobject,10个anonymousfunction1activationobject,10个anonymousfunction2activationobject,并且这10... 阅读全文
摘要:
********************* from Professional JavaScript for Web DevelopmentExecution Context And Scope The execution context of a variable or function def... 阅读全文
摘要:
One of the key characteristics of function declarations is function declaration hoisting, whereby function declarations are read before the code exc... 阅读全文
摘要:
Although using the object constructor or an object literal are convenient ways to create single objects, there is an obvious downside: creating mult... 阅读全文
摘要:
Prototype Chaining Recall the relationship between consructors, prototypes and instances: each constructor has a prototype object that points back to... 阅读全文
摘要:
ECMAScript variables may contains two different types of data: primitive values and reference values. Primitive values are simple atomic pieces of d... 阅读全文