Created
July 22, 2014 00:14
-
-
Save jikeytang/c95f42b08143a7972253 to your computer and use it in GitHub Desktop.
[ Javascript ] - 20140722-题目1
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 感谢深圳[时空]贡献 腾讯面试题一枚 | |
f = function() {return true;}; | |
g = function() {return false;}; | |
(function() { | |
if (g() && [] == ![]) { | |
f = function f() {return false;}; | |
function g() {return true;} | |
} | |
})(); | |
console.log(f()); | |
// true or false ? 为什么? | |
ps: | |
考察点: | |
作用域链(scope chain)、执行环境(execution context)、变量对象(variable object)命名函数表达式 等。 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
参考分析