[EcmaScript] Date作为普通函数来调用
2016-03-08 本文已影响33人
何幻
Date()
"Thu Feb 18 2016 13:20:36 GMT+0800 (CST)"
EcmaScript 6
20.3.2 The Date Constructor
The Date constructor is the %Date% intrinsic object and the initial value of the Date property of the global object.
When called as a constructor it creates and initializes a new Date object.
When Date is called as a function rather than as a constructor, it returns a String representing the current time (UTC).