當前位置:
首頁 >
前端技术
> javascript
>内容正文
javascript
you think you know javascript
生活随笔
收集整理的這篇文章主要介紹了
you think you know javascript
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
zaka在twitter發的回答Baranovskiy的So, you think you know JavaScript?,引起廣泛的關注。
那5道題目我猜測在國內確實能倒下一大片搞js開發的,一直以來感覺牛人不少,但也有為數不少的程序員缺乏腳踏實地的精神,缺乏鉆研的精神,希望能讓一部分人有所警醒。
摘抄原文如下: 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);
這次的問題不附答案,大家不要急著去搜,應該自己先想想。結果,然后運行代碼對比結果,再自己想想為什么,想不明白再去網上。
那5道題目我猜測在國內確實能倒下一大片搞js開發的,一直以來感覺牛人不少,但也有為數不少的程序員缺乏腳踏實地的精神,缺乏鉆研的精神,希望能讓一部分人有所警醒。
摘抄原文如下: 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);
這次的問題不附答案,大家不要急著去搜,應該自己先想想。結果,然后運行代碼對比結果,再自己想想為什么,想不明白再去網上。
轉載于:https://www.cnblogs.com/nozer0/archive/2010/01/31/1660518.html
總結
以上是生活随笔為你收集整理的you think you know javascript的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: Silverlight3 导航属性,En
- 下一篇: 偶得--Unity在asp.net mv