很有意思的JS

 每段放一起和分開執行結果是不一樣的

 

 

今天看到有5道Javascript題目,很有意思,值得琢磨。原文爲zaka在twitter發的回答Baranovskiy的So, you think you know JavaScript。原文如下:
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?

 

大家想想看吧

先不要偷看結果:
undefined
1
function a(x){
return x * 2;
}
10
[object]

 

原創文章如轉載,請註明:轉載自藍色騎兵 [ http://www.wkeke.cn/ ] 本文鏈接地址:http://www.wkeke.cn/archives/five-small-scripts/

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章