JS中的instanceof和typeof :
http://wasabi.iteye.com/blog/179335
疑问:
function f(){ return f; }
alert(new f()); // function f(){ return f; }
alert(new f() instanceof f); //弹出结果是false;
function f(){ }
alert(new f()); //object
alert(new f() instanceof f); //弹出结果是true;
答案: ‘new’ returns an instance of the class, unless the function that defines the class returns something else that is an object. So in this case, new f() just returns the function f itself and not an instance of it.