js基礎


數據類型

undefined,null,number,boolean,string,

null 和undefined值是相等的



typeof 運算符 :返回一個用來表示表達式的數據類型的字符串


typeof的運算數未定義或定義未賦值,返回的就是“undefined”

運算數爲數字 typeof(x) = "number"

字符串 typeof(x) = "string"

布爾值 typeof(x) = "boolean" true false

對象,數組和null typeof(x) = "object"

函數 typeof(x) = "function"


調試

alert

document.write()

console.log()



作用域,閉包

作用域爲可訪問變量,對象,函數的集合。


閉包是可訪問上一層函數作用域裏變量的函數,即便上一層函數已經關閉。


見此文檔 http://blog.csdn.net/zzulp/article/details/8144520





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