r/javascript • • May 28 '19

What are some JavaScript things beginners don't know?

333 Upvotes

383 comments sorted by

View all comments

1

u/[deleted] May 29 '19

You can create a date from pretty much any formatted date string without defining the format. Just like D = new Date(dateString). Very handy when comparing timestamps because then you can just call the getTime method on your date var and compare the time in milliseconds.