2 new出的对象 prototype与__proto__
2024-10-16 04:41:52
对象没有原型对象,函数才有
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()
最新文章
- linux中redis的php扩展安装
- 从ListView逐步演变到RecyclerView
- MYSQL进阶,新手变司机
- thinkphp实现导航高亮的简单方法
- PO_PO系列 - 询价报价单管理分析(案例)
- 剑指Offer:面试题3——二维数组中的查找(java实现)
- MarkdownPad2
- Linux Kernel空指针引用本地拒绝服务漏洞(CVE-2013-5634)
- ubuntu 引导删除
- python基础—函数装饰器
- Mysql锁机制--写锁
- 【第一章】zabbix3.4监控WindowsCPU使用率磁盘IO磁盘事件日志监控阈值邮件报警详细配置
- BZOJ1468Tree——点分治
- .so.x不是符号连接
- Scala断言
- java Date型时间比较大小
- selenium验证码和错误截图
- 布局中的BFC---重点是前言
- [Android] 旋转照片/图片
- 华为MSTP负载均衡配置示例
热门文章
- 2018.09.01 独立集(树形dp)
- 【Unity】2.2 Unity编辑器中的常用菜单项
- Unable to load tag handler class ";com.showId.Id.ShowId"; for tag ";ShowId:ShowId";] with root cause错误的解决方案
- (线段树)Balanced Lineup --POJ --3264
- Codeforces735C Tennis Championship 2016-12-13 12:06 77人阅读 评论(0) 收藏
- OpenGl 坐标转换 (转载)
- PGF基本图形对象
- Windows / Windows Phone 8.1 预留应用名称及应用上传
- Linux测试上行和下载速率
- dorado7-HelloWorld