| EcmaScript有两种属性 | 数据属性 和 访问器属性 | 
| 数据属性有4个特性 | Configurable Enumerable Writable Value 前三个值的默认值都为false 举例 Object.defineProperty( person, "name", { writable:false, value:"niko"} ) ; 一旦属性定义为不可配置的,就不能再把它变回可配置的了 | 
| 读取属性 的特性 | var descriptor  = Object.getOwnPropertyDescriptor( book, "_year" ) descriptor.value descriptor.configurable  | 
| 使用构造函数模式创建对象 | function Person( name,age,job ){   this.name = name ;   this.age = age ;   this.sayName = function(){      alert( this.name )    } } | 
| 用原型模式创建对象 | function Person(){} Person.prototype.name = "jeff"; Person.prototype.age = 28 好处是 可以让所有对象实例共享它所包含的属性和方法, Person.prototype指向了原型对象 而Person.prototpe.constuctor 又指向了Person | 
| 判断类型 | Person.prototype.isPrototypeOf( person1 ) // true  Object.getPrototypeOf( person1 ) == Person.prototype ) ; //true | 
| 判断一个属性是在原型中,而不是在实例中 | function hasPrototypeProperty( object, name ){   return !object.hasOwnProperty( name ) && ( name is object ) ; | 
| 取得对象上所有可枚举的实例属性 | Object.keys() 方法 | 
| 如果你想要得到所有实例属性,无论它是否可枚举,都可以用方法 | Object.getOwnPropertyNames() d var keys = Object.getOwnPropertyNames( Person.prototype ); //"constructor name age job sayName  | 
| 使用constructor不能确定对象的类型 | var friend = new Person() friend instanceof Object //true friend instanceof Person //true friend.constructor == Person // false friend.constructor == Object // true | 
| 实例 和 原型 之间通过什么链接 | 只是一个指针 而非副本 | 
| 在原生对象的原型上添加方法 | String.prototype.startWith = function(text) {   return this.indexOf(text) == 0 } var msg = "hello world" msg.startWith("hello"); | 
| 原型对象的缺点 | 最大问题是 由其共享的本性所导致的 function Person(){} Person.prototype = { constructor:Person, name:"nico",friends:["a","b"]} var p0 = new Person(); var p1 = new Person(); p0.friends.push("c"); 那么p1的friends里也会有c | 
| 组合使用构造函数模式 和 原型模式 | 构造函数模式用于定义 实例属性 ,而原型模式用于定义方法和共享的属性 function Person( name, age, job ){     this.name = name;     this.age = age ;     this.job = job ; } Person protytype = {     constructor:Person,     sayName: function(){          alert( this.name ) ;     } } | 
| 动态原型模式 | function Person( name, age, job ){      this.name = name       this.age = age ;      this.job = job ;      if( typeof this.sayName != "function" ){           Person.prototype.sayName = function(){} ;      } } | 
| 寄生构造函数模式 | 待补 | 
| 稳妥构造函数模式 | 待补 | 
| 继承 | 待补 | 
读书笔记 - js高级程序设计 - 第六章 面向对象的程序设计
原文:http://www.cnblogs.com/jason-beijing/p/7235684.html