Learning Materials
Entry:
Http://samsungapps.csdn.net/text.html? Arcid = 1, 311044
After learning about npm, install the dependent modules in the default lib directory of node. js, similar to python's easy_install (in fact, most of them are copy)
Advanced:
Advanced Article http://archive.cnblogs.com/a/2127237/
Reading the node beginner book will give you a rough idea of passing the function parameters of the event model.
In-depth:
Http://www.cnblogs.com/phphuaibei/archive/2011/09/03/2165437.html
Eclipse js plug-in
: Http://download.macromedia.com/pub/labs/jseclipse/autoinstall
Use prototype of js:
A common method (I am surprised to see it ):
var Closure = function(){}
Closure.prototype={
hello:function(){
console.log("hello world")
}
}
c = new Closure()
c.hello()
All objects can have prototypes, and prototypes can also have prototypes. In this way, a prototype chain is formed after a loop,
This chain is terminated when prototype in the formation in the chain is null. (The default prototype of the Object is null)
Js closure
var name = "The Window";
var object = {
name : "My Object",
getNameFunc : function(){
var that = this;
return function(){
return that.name;
};
}
};
alert(object.getNameFunc()())
); //”My Object”
By default, this indicates that windows uses the Global name. You need to use the attribute name of the current object in the closure.
Js tips:
- The difference between variables defined by var and those without var: The global variables and local variables cannot be clearly identified, and the var declaration is applied to local variables. It is best to declare all variables with var.
- The closure brings out the scope containing the function, which will occupy more memory and should not be used as little as possible.
The setTimeout and setInterval syntaxes are the same. They all have two parameters: one is the code string to be executed, and the other is the interval in milliseconds. after that period, the code will be executed. However, there are differences between the two functions. After the setInterval code is executed, it automatically repeats the code after the fixed interval, setTimeout only executes the code once.