对象和对象构造器的区别
普通的一种对象是:
var person = {
firstName = “Bill”,
lastName = “Gates”,
age = 20,
fullName = function(){
return this.firstName + " " + this.lastName;
}
};
对象类型:
function Person(first, last, age, eye) {
this.firstName = first;
this.lastName = last;
this.age = age;
原创
2020-11-02 19:50:48 ·
230 阅读 ·
0 评论