this
1、普通函数this指向window
2、有事件源的this指向事件源
3、settimeout下this指向window
4、对象里this指向当前对象
/*function abc(){
console.log(this); //abc
}
abc();*/
/*document.onclick = function(){
console.log(this); //document window
}*/
/*setTimeout(function(){
console.log(this); //settimeout window
},0)*/
/*var a = {
con:function(){
console.log(this);
}
}
a.con();*/
/* 植物
人类 黄种人 |白种人 | 黑种人
地球 生物 微生物
植物
人类 做饭| 种树 | 砍树 | 做工具
地球 生物 微生物
杂交
String substing,
Number tan
浏览器 object Boolean tan
undefined
tan a
abc
* */
不是所有东西都是绝对的
//String = Number = null;
/*String = Number;
var a = new String('123');*/
//var a = new Number(123);
//console.log(a);
//alert = setTimeout = null;
//alert(1);
/*setTimeout(function(){
console.log(1);
},0)*/
//alert = console;
/* String.prototype.da = function(){
return this[0].toUpperCase()+this.substr(1);
};
console.log('baoshu'.da());*/
/* Object.prototype.tan = function(){
console.log('谈谈谈');
}
// var a = new Number(123);
var a = new String('qwe');
a.tan();*/
/* function tan(){
this.a = 123;
}
tan.prototype.abc = 999;
new tan();
console.log( new tan().abc)
*/
/*var a = {
name:'n'
}
a.substring(1);*/
/*function a(x,y,z){
this.k = 12;
//console.log(this,x,y,z);
}*/
//a.call(1,2,3,4);
//a.apply(1,[2,3,4]);
/*function b(){
a.apply(this);
}
console.log(new b().k)
*/