nerv_,
function is(str, obj) {
var type = {}.toString.call(obj).toLowerCase();
type = type.slice(7);
return type.indexOf(str.toLowerCase()) != -1 && !(obj !== obj);
}
console.log(is("array", []));
console.log(is("number", 3));
console.log(is("number", "3"));
console.log(is("object", undefined));
При желание можно сократить)
Date.isDate = function(v) {
return is("Date", v);
};