上一页 1 ··· 3 4 5 6 7 8 9 10 11 下一页
摘要: Any variable defined inside a function is considered private since it is inaccessable outside that function. This includes function arguments, local... 阅读全文
posted @ 2015-05-19 11:23 林大勇 阅读(301) 评论(0) 推荐(0) 编辑
摘要: 1 function MyObject(){ 2 // private variables and functions 3 var privateVariable = 10; 4 5 function privateFunction(){ 6 return false; ... 阅读全文
posted @ 2015-05-18 16:55 林大勇 阅读(162) 评论(0) 推荐(0) 编辑
摘要: 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... 阅读全文
posted @ 2015-05-17 11:14 林大勇 阅读(170) 评论(0) 推荐(0) 编辑
摘要: 我是这么理解的; (object.getName = object.getName),这条语句在执行结束后,返回的是右操作数object.getName; 但是关键是这个右操作数现在放在哪里 ? 我猜想因为这条语句是在全局中执行的,所以在全局中会有一个临时的变量,不妨命名为temp; 且temp =... 阅读全文
posted @ 2015-05-17 09:54 林大勇 阅读(175) 评论(0) 推荐(0) 编辑
摘要: 然后第二段代码执行过程中,有1个globalvariabeobject,1个createFunctionactivationobject,10个anonymousfunction1activationobject,10个anonymousfunction2activationobject,并且这10... 阅读全文
posted @ 2015-05-17 09:51 林大勇 阅读(128) 评论(0) 推荐(0) 编辑
摘要: ********************* from Professional JavaScript for Web DevelopmentExecution Context And Scope The execution context of a variable or function def... 阅读全文
posted @ 2015-05-13 10:59 林大勇 阅读(334) 评论(0) 推荐(0) 编辑
摘要: One of the key characteristics of function declarations is function declaration hoisting, whereby function declarations are read before the code exc... 阅读全文
posted @ 2015-05-12 21:56 林大勇 阅读(204) 评论(0) 推荐(0) 编辑
摘要: Although using the object constructor or an object literal are convenient ways to create single objects, there is an obvious downside: creating mult... 阅读全文
posted @ 2015-05-08 20:57 林大勇 阅读(236) 评论(0) 推荐(0) 编辑
摘要: Prototype Chaining Recall the relationship between consructors, prototypes and instances: each constructor has a prototype object that points back to... 阅读全文
posted @ 2015-05-08 17:39 林大勇 阅读(341) 评论(0) 推荐(0) 编辑
摘要: ECMAScript variables may contains two different types of data: primitive values and reference values. Primitive values are simple atomic pieces of d... 阅读全文
posted @ 2015-05-08 14:00 林大勇 阅读(150) 评论(0) 推荐(0) 编辑
上一页 1 ··· 3 4 5 6 7 8 9 10 11 下一页