Created
August 19, 2014 16:08
-
-
Save jikeytang/2394bbf1cc5a431f6ea5 to your computer and use it in GitHub Desktop.
[ Javascript ] - 20140820-题目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
var foo = { | |
bar: function() { return this.baz; }, | |
baz: 1 | |
}; | |
(function(){ | |
return typeof arguments[0](); | |
})(foo.bar); | |
求出以上表达式的值,为什么? | |
PS: | |
1. 回复时注意加上下面这句话,才会有语法高亮或格式缩进。 | |
```javascript | |
// you code | |
``` | |
2. 粘贴代码时请使用shift+tab,缩进前面的空白。 |
rambo-panda
commented
Aug 20, 2014
PS:
未定义;
结果为undefined , 因为 在这里 我们穿进去的参数 foo.bar 仅仅是一个函数 ,而arguments0调用时 并没有指定谁调用他,那么就是window ,但是window.bar并没有被声明或者负值
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment