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 :: react native run ios release 
Javascript :: vowel array 
Javascript :: ternary operator angular template 
Javascript :: javascript date custom string format 
Javascript :: export apk react native 
Javascript :: Cannot resolve taglib with uri http://java.sun.com/jsp/jstl/core 
Javascript :: return empty new promise 
Javascript :: Reached heap limit Allocation failed - JavaScript heap out of memory nodejs 
Javascript :: reactbootstrap multiselect 
Javascript :: how to remove space in input field html 
Javascript :: jquery match height,jquery matchheight 
Javascript :: angular refresh token 
Javascript :: javascript make async get request 
Javascript :: Object.hasOwnProperty.call 
Javascript :: promise catch 
Javascript :: express routing 
Javascript :: get name of class javascript 
Javascript :: javascript get device width 
Javascript :: What is the Difference between Undefined, undeclared, Null 
Javascript :: get all keys in json object 
Javascript :: add sass to react 
Javascript :: react set cookie 
Javascript :: js string times 
Javascript :: table sort datatable 
Javascript :: get unique array javascript 
Javascript :: how to delete element in array in javascript 
Javascript :: correct json type 
Javascript :: chart.js label word wrap 
Javascript :: react-native-screens 
Javascript :: scrolltop in javascript 
ADD CONTENT
Topic
Content
Source link
Name
2+4 =