js Date function All In One
new Date() & new Date & Date() & Date
Date.now();
// 1625994483254
(Date.now()).toLocaleString();
// "1,625,994,517,358"
(new Date()).toLocaleString();
// "7/11/2021, 5:09:01 PM"
(new Date).toLocaleString();
// "7/11/2021, 5:09:07 PM"
new Date;
// Sun Jul 11 2021 17:13:10 GMT+0800 (China Standard Time)
new Date();
// Sun Jul 11 2021 17:13:15 GMT+0800 (China Standard Time)
Date;
// ƒ Date() { [native code] }
Date();
// "Sun Jul 11 2021 17:09:18 GMT+0800 (China Standard Time)"
(Date).toLocaleString();
// "function Date() { [native code] }"
(Date()).toLocaleString();
// "Sun Jul 11 2021 17:09:45 GMT+0800 (China Standard Time)"
SPA 不同tab 下相同的页面是不同的 window 对象 ✅
不存在修改同一个对象导致冲突的问题