标签:
function
Prince(name,age){
this
.gender=
"male"
;
this
.kind=
true
;
this
.rich=
true
;
this
.name=name;
this
.age=age;
}
Prince.prototype.toFrog=
function
(){
console.log(
"Prince "
+
this
.name+
" turned into a frog."
);
}
var
prince=
new
Prince(
"charming"
,25);
prince.toFrog();
//Prince charming turned into a frog.
prince.kind;
//true
标签:
原文地址:http://www.cnblogs.com/Yirannnnnn/p/4899281.html