对象没有原型对象,函数才有

new出的对象,this的会重新创建,二prototype并不会重新创建,而是追溯原型链的方式进行继承
var Book=function(id,bookname,price){
this.id=id;
this.hh = function () { console.log("hh执行了")}
return this;
}
console.log(Book.prototype)
Book.heihei=function(){console.log("heihei")}
Book.prototype.dispay=function(){console.log("111111111")}
let che=new Book(2);
console.log(che)
console.log(che.id, 'id')
console.log(che.hh, 'hh函数')
che.hh()
console.log(che.prototype)
console.log(che.dispay)
che.dispay()

最新文章

  1. linux中redis的php扩展安装
  2. 从ListView逐步演变到RecyclerView
  3. MYSQL进阶,新手变司机
  4. thinkphp实现导航高亮的简单方法
  5. PO_PO系列 - 询价报价单管理分析(案例)
  6. 剑指Offer:面试题3——二维数组中的查找(java实现)
  7. MarkdownPad2
  8. Linux Kernel空指针引用本地拒绝服务漏洞(CVE-2013-5634)
  9. ubuntu 引导删除
  10. python基础—函数装饰器
  11. Mysql锁机制--写锁
  12. 【第一章】zabbix3.4监控WindowsCPU使用率磁盘IO磁盘事件日志监控阈值邮件报警详细配置
  13. BZOJ1468Tree——点分治
  14. .so.x不是符号连接
  15. Scala断言
  16. java Date型时间比较大小
  17. selenium验证码和错误截图
  18. 布局中的BFC---重点是前言
  19. [Android] 旋转照片/图片
  20. 华为MSTP负载均衡配置示例

热门文章

  1. 2018.09.01 独立集(树形dp)
  2. 【Unity】2.2 Unity编辑器中的常用菜单项
  3. Unable to load tag handler class "com.showId.Id.ShowId" for tag "ShowId:ShowId"] with root cause错误的解决方案
  4. (线段树)Balanced Lineup --POJ --3264
  5. Codeforces735C Tennis Championship 2016-12-13 12:06 77人阅读 评论(0) 收藏
  6. OpenGl 坐标转换 (转载)
  7. PGF基本图形对象
  8. Windows / Windows Phone 8.1 预留应用名称及应用上传
  9. Linux测试上行和下载速率
  10. dorado7-HelloWorld