Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

javascript check if date object

let date1 = new Date();
let date2 = new Date("random string");

(Object.prototype.toString.call(date1) === '[object Date]' && date1 != "Invalid Date") // true
(Object.prototype.toString.call(date2) === '[object Date]' && date2 != "Invalid Date") // false
Comment

PREVIOUS NEXT
Code Example
Javascript :: if select option disabled jquerz 
Javascript :: replace string using javascript 
Javascript :: laravel csrf token ajax post 
Javascript :: remove a specific element from an array 
Javascript :: sort from the key value js 
Javascript :: traverse an array in javascript 
Javascript :: javascript replace doublequote with empty string 
Javascript :: Jquery trigger change event upon dom ready 
Javascript :: how to check if a string is in a string js 
Javascript :: how to get the first letter of a string in jquery 
Javascript :: serialization and deserialization in javascript 
Javascript :: transitionduration js 
Javascript :: refresh datatable on button click with maintaining paging 
Javascript :: Vuejs v-model when enter pressed 
Javascript :: mysql query node.js 
Javascript :: jquery change select option text 
Javascript :: react js materilize 
Javascript :: material ui align icon with text 
Javascript :: get data from url javascript 
Javascript :: iterate object js 
Javascript :: ... unicode 
Javascript :: remove single item from array in angular 
Javascript :: Sum of odd Fibonacci numbers JS 
Javascript :: javascript check if string is valid hex color 
Javascript :: react detect enter key 
Javascript :: discord.js listen for message 
Javascript :: tofixed currency in js 
Javascript :: .textcontent 
Javascript :: hex to rgba in js 
Javascript :: jquery version how 
ADD CONTENT
Topic
Content
Source link
Name
3+1 =