<script type="text/javascript">
//1.可以通过new对象的方法,称之为“构造函数”,采用pascal命名法
function Person(name,age,email) {
this.name = name;
this.age = age;
this.email = email;
this.sayHello = function () {
alert('hi,我叫' + this.name + '我今年' + this.age + '岁了');
};
}
var zs = new
JS面向对象练习
最新推荐文章于 2022-05-12 21:29:41 发布