判断变量是不是是日期类型

判断变量是否是日期类型function testObjectType(val) {var tswitch(val) {??? case null: t null b

判断变量是否是日期类型

function testObjectType(val) {
var t;
switch(val) {
??? case null: t = "null"; break;
??? case undefined: t = "undefined"; break;
??? default:
??????? t = Object.prototype.toString.call(val).match(/object\s(\w+)/)[1];
??????? break;
}
return? t.toLowerCase();
}

?

?

如果是日期类型则返回值是"date"