原型链(如下所示):
看不太懂,甚至是一脸懵逼???对不对
- 那可以花点时间认真看完本篇文章哦~
__proto__)和构造函数(porototype)原型对象都有一个属性 constructor 属性
关于对象原型(
__proto__)和构造函数(porototype)原型对象的介绍在第二章节哦!!

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
</head>
<body>
<script>
// 公共属性定义到构造函数里面,公共方法放到原型对象身上
function Star(uname, age) {
this.uname = uname;
this.age = age;
}
// Star.prototype.sing = function() {
// console.log('我会唱歌');
// }
Star.prototype = {
// 如果哦们修改了原来的原型对象,给原型对象赋值的是一个对象,必须手动利用constructor指回原来的构造函数
constructor: Star,
sing: function() {
console.log('我会唱歌');
},
movie: function() {
console.log('我会演电影');
}
}
var ldh = new Star('刘德华', 18);
var zxy = new Star('张学友', 19);
console.log(Star.prototype);
console.log(ldh.__proto__);
</script>
</body>
</html>

1 
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Document</title>
</head>
<body>
<script>
function Star(uname, age) {
this.uname = uname;
this.age = age;
}
Star.prototype.sing = function() {
console.log('我会唱歌');
}
var ldh = new Star('刘德华', 18);
// 1. 只要是对象就有__proto__ 原型, 指向原型对象
console.log(Star.prototype);
console.log(Star.prototype.__proto__ === Object.prototype);
// 2.我们Star原型对象里面的__proto__原型指向的是 Object.prototype
console.log(Object.prototype.__proto__);
// 3. 我们Object.prototype原型对象里面的__proto__原型 指向为 null
</script>
</body>
</html>
原型链 :

__proto__指向的prototype原型对象)__proto__对象原型的意义: 为对象成员查找机制提供一个方向,或者说一条路线
<script>
function Star(uname, age) {
this.uname = uname;
this.age = age;
}
Star.prototype.sing = function() {
console.log('我会唱歌');
}
// Star.prototype.sex = '女';
// Object.prototype.sex = '男';
var ldh = new Star('刘德华', 18);
console.log(ldh.sex);
</script>
原型对象函数里面的this指向 实例对象(new 构造函数())
<script>
function Star(uname, age) {
this.uname = uname;
this.age = age;
// 1. 在构造函数中,里面this指向的是对象实例
console.log(this);
}
var that;
Star.prototype.sing = function() {
console.log('我会唱歌');
that = this;
}
var ldh = new Star('刘德华', 18);
ldh.sing();
// 2. 原型对象函数里面的this指向的是 实例对象
console.log(that === ldh);
</script>


_proto___proto__,指向我们构造函数的原型对象__proto__ 指向 构造函数的prototpe原型对象
__protot__原型的存在,=== prototype
