JS中的面向对象
functon createPerson(name,sex,birthday) { var oPerson = new Object; oPerson.name =name; oPerson.sex = sex; oPerson.birthday = birthday; oPerson.sayHi = function() { alert("Hi ! I am "+this.name); } return oPerson; } //那么我们多创建几个人的话,就可以 var person1 = new createPerson('zs','boy','2001-02-03'); var person2 = new createPerson('ls','boy','2001-02-04'); person1.sayHi(); person2.sayHi();