1、变量和函数的提前
第一个
alert(foo)是因为第一行的var foo=1;提前了,成为var foo;因此首先结果是undifined
alert(this.foo) 其中this指window,因此是指第一行的foo,因此结果是1
第二个
alert(foo)理由同上,结果undifined
alert(this.foo)因为用的new新建构造函数,this就指向main函数,然后var foo=2;提前,变成var foo,因此结果是undifined
e,e.target跟tagName的区别
http://www.educity.cn/wenda/147917.html
二、经典JS题(作用于、原型链)
http://www.cnblogs.com/dunken/p/4362081.html
1、考察延时,单线程
先执行alert(0)
然后执行var a=1
因为要延时1000,所以接着执行a=2
1000过去后,执行alert(a),这时a=2
然后,因为要延时3000,所以先执行a=3
3000过去后,执行alert(a),这时a=3
2、
split
replace
正则表达式
-moz-对应 Firefox,
-webkit-对应 Safari and Chrome
-o- for Opera
-webkit-对应 Safari and Chrome
-o- for Opera
-ms- for Internet Explorer
https://www.zhihu.com/question/20597072
没看懂
3、true true
考察instanceof
http://www.studyofnet.com/news/175.html