【转】So, you think you know JavaScript?
2010-06-09 17:22
316 查看
http://dmitry.baranovskiy.com/
Quick test for real understanding of JavaScript core beyond closures and scopes. Here five small scripts. Try to answer what will be alerted in each case without running them in the console. Then you could create a test file and easily check your answers. Ready?
Quick test for real understanding of JavaScript core beyond closures and scopes. Here five small scripts. Try to answer what will be alerted in each case without running them in the console. Then you could create a test file and easily check your answers. Ready?
if (!("a" in window)) { var a = 1; } alert(a);
var a = 1, b = function a(x) { x && a(--x); }; alert(a);
function a(x) { return x * 2; } var a; alert(a);
function b(x, y, a) { arguments[2] = 10; alert(a); } b(1, 2, 3);
function a() { alert(this); } a.call(null);
相关文章推荐
- So, you think you know JavaScript?
- So, you think you know JavaScript?(转)
- So,you think you know JavaScript?
- So, you think you know JavaScript? (你认为你懂JS吗)
- So, you think you know JavaScript?
- you think you know javascript?
- you think you know javascript
- Think You Know Javascript? (2)
- 6 Advanced JavaScript Techniques You Should Know
- You Think You know How to install SQL Server?
- 10 Small Things You May Not Know About Javascript
- What you should know about .so files
- Javascipt, that you do not know yet——Javascript Garbage Collection
- JavaScript-读 You Dont Know JS,原型继承不是继承
- Six JDK Classes You Think You Know
- A collection of not-so-obvious Python stuff you should know
- 每日英语:Everything You Think You Know About China Is Wrong
- 【转】JavaScript Event Delegation is Easier than You Think
- Do You Really Know about string.replace() in JavaScript?
- JavaScript-读 You Dont Know JS, Object到底是什么