1.Boolean
構造函數:
構造函數new Boolean(value)會將參數轉換為布爾值,并返回一個包含該值的Boolean對象。
轉換函數Boolean(value)將參數轉換成一個原始的布爾值,并返回該值。
NaN,0,null,” ”,undefined,false都會轉換成false,其他原始值都會轉為true。
方法:
toString()根據對象所代表的布爾值返回“true”“false”。
valueOf()返回Boolean對象中存放的原始布爾值。
2.Date
構造函數:
new Date()
new Date(milliseconds)
new Date(datestring)
new Date(year,month,day,hours,minutes,seconds,ms)
方法:
getDate()返回一個Date對象的月份中的日期值1~31
getDay()返回一個Date對象的一周中的日期值
getFullYear()年份值
getHours()小時值
getMilliseconds()毫秒值
getMinutes()分鐘值
getMonth()月份值
getSeconds()秒鐘值
getTime()以毫秒形式返回
getTimezoneOffset()取得與GMT時間之間的差
getUTCDate()日期值1~31(全球時間),以上皆可同理。
setDate()設置一個Date對象的一月中的日期值,以上皆可同理。
now以毫秒形式返回當前時間
parse解析一個日期/時間字符串
decodeURIComponent:解碼一個URI組件中的字符
encodeURIComponent:轉義URI組件中的字符