来点干货 给你
function a(b) {
this.b = b;
}
a.prototype.b = 3;
function b() {
a.call(this, 2);
}
b.prototype = new a();
var c = new b();
alert(c.b);
delete c.b;
alert(c.b);
delete b.prototype.b;
alert(c.b);
function a(b) {
this.b = b;
}
a.prototype.b = 3;
function b() {
a.call(this, 2);
}
b.prototype = new a();
var c = new b();
alert(c.b);
delete c.b;
alert(c.b);
delete b.prototype.b;
alert(c.b);
this.b = b;
}
a.prototype.b = 3;
function b() {
a.call(this, 2);
}
b.prototype = new a('傻逼');
var c = new b();
alert(c.b);
delete c.b;
alert(c.b);
delete b.prototype.b;
alert(c.b);
很怀疑你都知道第三个alert了 却不知道第二个怎么是undefined
1. JavaScript The Good Parts
2. Professional JavaScript for Web Developer
3. JavaScript Definitive Guide 5 or 6th Edition
4. Pro JavaScript Design Patterns
5. Eloquent JavaScript
6. Effective JavaScript: 68 Specific Ways to Harness the Power of JavaScript
7. Object-Oriented JavaScript
1:想学好js,首先把html的各种标签,对应标签的属性,都要了解下,那样做到用的时候不会觉得生疏。
2:其次是理解好DOM模型
3:学好js的语法,像js的数组、定时器,对象创建的几种方式、对象的继承等等这些都要理解掌握
4:要主要js的应用场景,比如响应事件等等这些
相信有了这些,就可以稍稍有点成就感了