function Person(name, age, job) { this.name = name; this.age = age; this.job = job; this.sayName = function() { alert(this.name); }; } var person1 = new Person("Mary", 29, "Software Engineer"); var person2 = new Person("Mike", 29, "Software Engineer");
创建对象之构造函数模式
猜你喜欢
转载自www.cnblogs.com/soldierback/p/10697802.html
今日推荐
周排行