new function
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title></title>
</head>
<body>
<script>
// var F=function(){};
// Object.prototype.a=function(){};
// Function.prototype. b=function(){};
// var f=new F();
// f.a;
// f.b;
function Person(){}
var friend = new Person();
Person.prototype = {
constructor : Person,
name : "kayorl",
sayName : function () {console.log(this.name);}
}
friend.sayName(); //ERROR
</script>
小红书 P156页,可知原型修改后, 切断了原来原形与 更改后原形的关系
</body>
</html>
前端笔记0-0