function Person(name, age) {
this.name = name;
this.age = age;
}Person.prototype.sayMyName = function() {
alert(this.name);
}
Person.prototype.sayMyAge = function() {
alert(this.age);
}mike = new Persion('mike', 1);
就这样一个简单的mike对象,创建出来占多少内存?
this.name = name;
this.age = age;
}Person.prototype.sayMyName = function() {
alert(this.name);
}
Person.prototype.sayMyAge = function() {
alert(this.age);
}mike = new Persion('mike', 1);
就这样一个简单的mike对象,创建出来占多少内存?
比如说,你用chrome处理js的速度毫无疑问比ie要快上许多~~
在某些时候甚至是倍数关系(其实这个和内存占用关系很大)