javascript继承--原型链的 继承
作者的话:原型链是JavaScript中相当重要的一个知识点,这里我使用了函数结构图,来帮助我更好的理解
/*
原型链继承方式:
通过改变一个对象的原型对象的指向来继承另一个对象
原理:
我们知道,一个对象的实例会继承他的原型对象的所有属性和方法。所以说,如果,我们继承对象的原型对象,是被继承对象的原型对象的实例的话,那么,他不就继承了被继承对象的原型对象的所有属性和方法了么
*/
//创建一个被继承对象,并给他两个属性
function a(){
this.name = "兔子只吃胡萝卜";
this.age=12;
} /*
利用构造方法来创建继承对象
*/
//创建一个继承对象,这里我们不给他设置任何属性
function b(){
}
//我们让继承对象的原型对象得到被继承对象的实例
b.prototype = new a();
//我们为继承对象创建一个实例
var b1 = new b();
console.log(b1.name);//"兔子只吃胡萝卜"
console.log(b1.age);// /*
直接创建继承对象的实例
*/
var c = {
};
c.__proto__ = new a();
console.log(c.name);//"兔子只吃胡萝卜"
console.log(c.age);//
aaarticlea/png;base64,iVBORw0KGgoAAAANSUhEUgAAAu0AAAJiCAIAAAD8Oms9AAAgAElEQVR4nO3dT46rxtoHYFb16ciruVIibyWDZOB9ZJI78TIyiu7Em8jsqEf+Bm7bFBRFgflX8Lx6dNTHxoCp19Svsbu7+vr5LwBAiarV9wAAYBw5BgAolRwDAJRKjgEASiXHAAClkmMAgFLJMQBAqeQYAKBUcgwAUCo5BgAolRwDAJRKjgEASiXHAAClkmMAgFLNkmOqjJp7E4NW1XVL4670aj9ZOPNRAEBd/6zZlRISoaF3Mp4kx+Svs2v/c1bV9XXvLuUvnLOJmeIgABQtdyJszP3tu7puyXzI4P0eEhq+YqklnWMa9/YGiK6VRJdvrzz676AjABRh6Lmrdw3te4d+z5NzQotuZcLj8OExyX/U0JV3Hc/Jz8CTd0J0mXGTS/6+zXd8UhsddLwyQ0n9lujAf/4M66vKaa/2prt2pmvf0q+6xtbT62xsuv1cep971gH857cf1X/++8lx/nwNQGjQvNI4l+Y8pHeLiRX2bmLCKap3E71n9fx1RhfL3NCgGaE9uPlPYcRRzXlI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Qcs/ghXfuYb+UTLdOWHANsijPOUgdajln8kK59zOUYgNk54yx1oOWYxQ/p9Mf8/S5PbzV+NmmVHZh008+SY4BNccZZ6kCXU6sfq/xD+uGMq0ZUzmFfvTeA43DGoVRyzColxwCb4oxDqeSYVUqOATbFGYdSyTGrlBwDbIozDqWSY1YpOQbYFGccSiXHrFJyDLApzjiUSo5ZpeQYYFOccShVzoSq5ig5BtgOZxxK1TuhqlVKjgGW5IxDqeSYbZYcAyzJGYdSyTHbLDkGWJIzDqWSY7ZZcgywJGccSiXHbLPkGGBJzjiUSo7ZZskxwJKccSiVHLPNkmOAJTnjUCo5ZpslxwBLcsahVHLMNkuOAZbkjEOp5JhtlhwDLMkZh1LJMdssOQZYkjMOpZJjtllyDLAkZxxKJcdss+QYYEnOOJRKjtlmyTHAkpxxKJUcs82SY4AlOeNQKjlmmyXHAEtyxqFUcsw2S44BluSMQ6nkmG2WHAMsyRmHUskx2yw5BliSMw6lkmO2WXIMsCRnHEolx2yz5BhgSc44lEqO2WbJMcCSnHEoVaW2Wqv3BnAczjgAQKnkGACgVHIMAFAqOQYAKJUcAwCUSo4BAEolxwAApZJjAIBSyTEAQKnkGACgVHIMAFAqOQYAKJUcAwCUSo4BAEolxwAApZJjAIBSyTEAQKnkGACgVHIMAFAqOQYAKJUcAwCUSo4BAEolxwAApZJjAIBS/T8PS4CXp9hb+QAAAABJRU5ErkJggg==" alt="" />
原型链继承中,存在着缺陷,其中,最明显的缺陷就是在使用引用类型的时候,会导致原型对象中,引用的数据发生改变,从而影响了我们需要使用的数据
javascript继承--原型链的 继承的更多相关文章
- Javascript的原型链与继承
目录 1. ES5最经典的寄生组合式继承图 2. ES5和ES6的继承 Javascript语言的继承机制,它没有"子类"和"父类"的概念,也没有"类 ...
- JavaScript使用原型链实现继承
JavaScript实现继承的思想: 一句话总结,让子类的原型等于父类的实例. 详细来说,其实利用了原型的性质即在JavaScript中所有被实例化对象具有相同的原型属性和方法,每一个被实例化对象的原 ...
- 三张图搞懂JavaScript的原型对象与原型链 / js继承,各种继承的优缺点(原型链继承,组合继承,寄生组合继承)
摘自:https://www.cnblogs.com/shuiyi/p/5305435.html 对于新人来说,JavaScript的原型是一个很让人头疼的事情,一来prototype容易与__pro ...
- 深入浅出JavaScript之原型链&继承
Javascript语言的继承机制,它没有"子类"和"父类"的概念,也没有"类"(class)和"实例"(instanc ...
- JavaScript原型链与继承
最近学习了<Javascript高级程序设计>面向对象部分,结合书中的例子总结一下原型链和继承部分的内容. 创建对象 在Js当中没有类这个概念,当我们想要创建具有相同属性的对象的时候,有如 ...
- 《JAVASCRIPT高级程序设计》根植于原型链的继承
继承是面向对象的语言中,一个最为津津乐道并乐此不疲的话题之一.JAVASCRIPT中的继承,主要是依靠原型链来实现的.上一篇文章介绍过,JAVASCRIPT中,每一个对象都有一个prototype属性 ...
- 对Javascript 类、原型链、继承的理解
一.序言 和其他面向对象的语言(如Java)不同,Javascript语言对类的实现和继承的实现没有标准的定义,而是将这些交给了程序员,让程序员更加灵活地(当然刚开始也更加头疼)去定义类,实现继承 ...
- Javascript 组合继承 原型链继承 寄生继承
Javascript继承通常有三种方式. 第一种:组合式继承: function SuperType(name) { this.name = name; this.colors = ["re ...
- JavaScript中的原型链和继承
理解原型链 在 JavaScript 的世界中,函数是一等公民. 上面这句话在很多地方都看到过.用我自己的话来理解就是:函数既当爹又当妈."当爹"是因为我们用函数去处理各种&quo ...
随机推荐
- ProjectManager Beta 2 项目管理器发布
上次载Alpha阶段有一个可用版本Alpha 8也在这个博客发布了,传送:http://www.cnblogs.com/deali/p/ProjectManager.html ProjectManag ...
- [CSS3] 学习笔记-CSS3选择器详解(一)
1.属性选择器 在CSS3中,追加了3个属性选择器,分别为:[att*=val].[att^=val]和[att$=val],使得属性选择器有了通配符的概念. <!doctype html> ...
- c# 应用NPOI 获取Excel中的图片,保存至本地的算法
要求:读取excel中的图片,保存到指定路径 思路: 利用NPOI中 GetAllPictures()方法获取图片信息 步骤: 1.新建一个Windows窗体应用程序 2.桌面新建一个excel,贴 ...
- json基础教程|理解Json
一. 在异步应用程序中发送和接收信息时,可以选择以纯文本和 XML 作为数据格式.这一期讨论一种有用的数据格式 JavaScript Object Notation(JSON),以及如何使用它更轻松地 ...
- java socket初步学习一 ( tcp)
Java socket通信程序: 第一版本: 实现功能: 服务器地址:127.0.0.1 端口:5050 客户机:端口5050 客户端发送字符:“t” 服务器接收到该字符并回复:“r” 流程: 建立 ...
- table中td的宽度不随文字变宽
1.设置了table的宽度后,宽度仍然不固定,td的内容一多,很容易吧table撑变形.有些时候我们需要设置固定的宽度. 解决办法 table的css 加入样式 table-layout:fixed ...
- testNG实现test失败后重复执行,
test失败自动执行大大提高测试结果的准确性, 1.修改testNG源码实现test失败自动执行, 首先获取testng的源码, 获取源代码,构建过程: $ git clone git://githu ...
- 【 js 算法类】数组去重
以 var arr = [1,2,3,1]; 作为测试用例 方法一:双循环 (时间复杂度比较高,性能一般.) A.(1) function unique(arr) { var newArr = [ ...
- 解决 Windows instance 时间不同步问题 - 每天5分钟玩转 OpenStack(153)
这是 OpenStack 实施经验分享系列的第 3 篇. 问题描述 通过上一节部署出来的 Windows instance 有时候会发现操作系统时间总是慢 8 个小时,即使手工调整好时间和时区,下次 ...
- ES6__异步开发优化
一:JS事件循环 1:同步调用 同步调用是一种阻塞式调用,调用要等待双方执行完毕才返回,他是一种单向调用. 2:回调 回调是一种双向调用模式,也就是说,被调用方在接口被调用时也会调用对方的接口. 3: ...