function的prototype

prototype只有function才有的属性。

var a = function() {
   this.age = 12;
   this.name = "haha";      
};

a.prototype = {
   address: "shanghai",
   price:13      
};

// prototype对象下的属性只有一个实例

 

posted @ 2015-01-12 19:20  daishuguang  阅读(223)  评论(0编辑  收藏  举报