Answers for "javascript detect if object is date"

4

javascript detect if object is date

var myDate=new Date();
if(myDate instanceof Date){
    //im a hot Date
}
Posted by: Guest on August-01-2019
3

javascript detect if object is date

//checks if is object, null val returns false
function isObject(val) {
    if (val === null) { return false;}
    return ( (typeof val === 'function') || (typeof val === 'object') );
}
var person = {"name":"Boby Snark"};
isObject(person);//true
Posted by: Guest on July-24-2019

Code answers related to "javascript detect if object is date"

Code answers related to "Javascript"

Browse Popular Code Answers by Language