标签:style color java os io ar cti javascript
function classof(o) { if (null == o) return ‘Null‘; if (undefined == o) return ‘Undefined‘; return Object.prototype.toString.call(o).slice(8, -1); } classof([]); classof({}); classof(Date); classof(new Date()); classof(/./); classof(1); classof(1.9); classof(null); classof(window);
Output:
"Array"
"Object"
"Function"
"Date"
"RegExp"
"Number"
"Number"
"Null"
"Window"
获取对象的类型信息 (JavaScript),布布扣,bubuko.com
标签:style color java os io ar cti javascript
原文地址:http://www.cnblogs.com/pengpenghappy/p/3902523.html