prototype只有function才有的属性。

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

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

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

 

相关文章:

  • 2022-03-08
  • 2021-07-29
  • 2021-08-06
  • 2021-12-29
  • 2021-05-15
  • 2021-07-26
  • 2021-08-02
  • 2022-12-23
猜你喜欢
  • 2021-07-29
  • 2022-12-23
  • 2022-12-23
  • 2021-09-25
  • 2022-01-12
  • 2022-02-19
  • 2022-12-23
相关资源
相似解决方案