标准对象
typeof 123
'number'
typeof '123'
'string'
typeof true
'boolean'
typeof NaN
'number'
typeof [ ]
'object'
typeof { }
'object'
typeof Math. abs
'function'
typeof undefined
'undefined'
Date基本使用
var now = new Date ( ) ;
now. getFullYear ( ) ;
now. getMonth ( ) ;
now. getDate ( ) ;
now. getDay ( ) ;
now. getHours ( ) ;
now. getMinutes ( ) ;
now. getSeconds ( ) ;
now. getMilliseconds ( ) ;
now. getTime ( ) ;
结果演示
now. getFullYear ( ) ;
2022
now. getMonth ( ) ;
4
now. getDate ( ) ;
6
now. getDay ( ) ;
5
now. getHours ( ) ;
14
now. getMinutes ( ) ;
49
now. getSeconds ( ) ;
13
now. getMilliseconds ( ) ;
624
now. getTime ( ) ;
1651819753624
转换
now = new Date ( 1651819753624 )
Fri May 06 2022 14 : 49 : 13 GMT + 0800 ( 中国标准时间)
now. toLocaleString ( ) ;
'2022/5/6 14:49:13'
now. toGMTString ( ) ;
'Fri, 06 May 2022 06:49:13 GMT'