var name = "world";
(function(){
if(typeof name ==="undefined"){
var name="jack";
console.log("Goodbye"+name);
}else{
console.log("hello"+name)
}
})()
function fun(n,o){
console.log(o);
return {
fun:function(m){
return fun(m,n);
}
}
}
var a=fun(0);
a.fun(1);
a.fun(2);
a.fun(3);
这是两个js面试题?谁能帮我解答一下,并告诉原理