Lai*_*290 -4 javascript console.log
当execute new Date()会返回一个字符串看起来像Tue Aug 11 2015 14:42:04 GMT-0300 (Hora oficial do Brasil)
当我使用typeof new Date()它时会返回一个object,直到这一点为止
但为什么我不能在Chrome控制台中显示您的属性和功能,但我可以访问他们的?
当我执行:
var date = new Date();
console.log(date);
Run Code Online (Sandbox Code Playgroud)
它会回来Tue Aug 11 2015 14:42:04 GMT-0300 (Hora oficial do Brasil),为什么不Date {....}呢?
@taxicala
我尝试创建fallowing类:
function teste() {
return 'Hello World';
}
var t = new teste();
typeof t; // "object"
console.log(t); // return 'teste{}'
Run Code Online (Sandbox Code Playgroud)
如何创建类(函数)之类的Date()?
| 归档时间: |
|
| 查看次数: |
107 次 |
| 最近记录: |