1.
var a= b
new
var a = new String(“text”);
var a = new String(“text”);


• new

• new
        String
String



new
new
this
function test(x,y){
      this.x = x;
      this.y = y;
  }

  var a = new test(1,2);


new test(1,2)       test


new
new                        this
this
var a= obj;

        a obj
this
this=
•
•   function(){
    …
    }



•
•
var test = function(x,y){
  this.x = x;
  this.y = y;
};

function test(x,y){
 this.x = x;
 this.y = y;
}
var test = function(){
   this.a = “abc”;
};
test.text = “          ”;
test.text2 = “              ”;
new
new
test
var test = function(){
   this.a = "abc";
};
test.text = "          ";
var a = new test();
console.log(a.a);
console.log(text.text);
console.log(a.text);
text
this
text
new
prototype
prototype
prototype
constructor
prototype
var test = function(){
	

 this.a = "abc";
};

//test.prototype
test.prototype = {
	

 constructor:function(){
       this.a= "abc"
    },
    __proto__:Object //IE
};
__proto__
                 prototype




IE   __proto__
prototype


new


      prototype
a.text = "1234"
   a text
2.
var a = {
  abc:"text"
};
{}
new
prototype


new
var test = {
  test : "text"
};
var Creator = function(){};
Creator.prototype = test;
var a = new Creator();
console.log(a.test);//text
CSS   cascade
new
jQuery
•                           new


•                            prototype


•   prototype


•   prototype

•
                prototype

Javascript3