\\通过valueOf()和getTime()方法
var date = new Date();
console.log(date.valueOf());
console.log(date.getTime());
\\通过+new
var date1 = +new Date();
console.log(date1);
\\终极写法Date.now(),H5新增语法,一句搞定
console.log(Date.now());

发表回复

后才能评论