“JS - дата” Ответ

JavaScript обнаружил, если объект - это дата

var myDate=new Date();
if(myDate instanceof Date){
    //im a hot Date
}
Grepper

JS - дата

typeof date.getMonth === 'function'
// you can use the instanceof operator, i.e. But it will return true for invalid dates too, e.g. new Date('random_string') is also instance of Date
date instanceof Date
// This will fail if objects are passed across frame boundaries.
// A work-around for this is to check the object's class via
Object.prototype.toString.call(date) === '[object Date]'
Tequilian

JavaScript обнаружил, если объект - это дата

//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
Grepper

Ответы похожие на “JS - дата”

Вопросы похожие на “JS - дата”

Больше похожих ответов на “JS - дата” по JavaScript

Смотреть популярные ответы по языку

Смотреть другие языки программирования