摘要:
图片的由来看下面: 1、hasOwnProperty:看是不是对象自身下面的属性 var arr = []; arr.num = 10; Array.prototype.num2 = 20; //所有的数组对象都有num2,并不只是arr自身的属性 //alert( arr.hasOwnProper 阅读全文
摘要:
原型链 : 实例对象与原型之间的连接,叫做原型链 –__proto__( 隐式连接 ),这就是原型链,平时我们是看不到的。 原型链的最外层 : Object.prototype function Aaa(){ //this.num = 20; } //Aaa.prototype.num = 10; 阅读全文
摘要:
首先我们可以看看平时我们常用的 var str = 'hello'; alert(typeof str); //string var str = new String("hello"); alert(typeof str); //object 上面那个是表示基本类型string类型,下面这个是表示对 阅读全文
摘要:
HTML部分 <div id="div1"></div> <div id="div2"></div> CSS部分 <style> #div1{width: 100px;height: 100px;background-color: red;position: absolute;} #div2{wid 阅读全文