<!DOCTYPE html>
<html>
<head>
<title></title>
</head>
<body>
<script type=
"text/javascript">
//以下es6
//类没有去原型里面找
</script>
</body>
</html>
<!DOCTYPE html
>
<html
>
<head
>
<title
></title
>
<style type
="text/css">
</style
>
</head
>
<body
>
<script type
="text/javascript">
class Person
{
constructor(myName
, myAge
)
{
this.name
= myName
;
this.age
= myAge
;
this.hi = function () {
console
.log("hi");
}
}
run()
{
console
.log("run");
}
}
let obj
={constructor
:Person
,type
:"cyg",say
:function()
{
console
.log(this.name
, this.age
);
}};
Person
.prototype
=obj
;
let p
= new Person("lnj", 34);
console
.log(p
);
</script
>
</body
>
</html
>