Testing Your Knowledge Of JavaScript’s Date Class

JavaScript is everywhere these days, even outside the browser. Everyone knows that this is because JavaScript is the best programming language, which was carefully assembled by computer experts and absolutely not monkeyed together in five days by some bloke at Netscape in the 90s. Nowhere becomes this more apparent than in aspects like JavaScript’s brilliantly designed Date class, which astounds people to this day with its elegant handling of JavaScript’s powerful type system. This is proudly demonstrated by the JS Date quiz by [Samwho].

Recently [Brodie Robertson] decided to bask in the absolute glory that is this aspect of JavaScript, working his way through the quiz’s 28 questions as his mind gradually began to crumble at the sheer majesty of this class’ elegance and subtle genius. Every answer made both logical and intuitive sense, and left [Brodie] gobsmacked at the sheer realization that such a language was designed by mere humans.

After such a humbling experience, it would only seem right to introduce the new JS convert to the book JavaScript: The Good Parts, to fully prepare them for their new career as a full-stack JS developer.

17 thoughts on “Testing Your Knowledge Of JavaScript’s Date Class

    1. Very true. Some of the answers are downright ridiculous or make no sense. Like UTC+1 is treated by the class as UTC-1.. How is that supposed to stay consistent with a unified timing scheme???

  1. Honourable mention of:
    https://wtfjs.com/

    And:
    https://www.wooji-juice.com/blog/javascript-article.html
    Which includes this quote:

    In fact, it’s a surprisingly powerful, expressive language, and could’ve been a very elegant bit of work.

    However, it is not.

    It is a dark festival of pain. Gotchas lurk in the darkness, biding their time. Brooding. Like bears: They Will Eat You.

  2. Long time since I’ve been chuckling almost continuously throughout a video.

    This actually shows why the whole world should standardise on ISO 8601 dates, so mine is, at the time of writing, 2025-07-22 or, with the time too, 2025-07-22T11:00:00+01:00

  3. Why don’t you go back to Java and it’s date handling around 1999. February 31st wants to hear from you.

    Seriously, date handling across damn near everything is filled with potholes and speed bumps. Try correcting for time zones and day light saving time on “partially” managed data.

  4. Laughing at Date is fun and all, but honestly we’re looking at a 30 years old spec that was hastily put together. Anyone serious about date manipulation today will use an external library, or the upcoming Temporal, Date’s native replacement, that is very elegant and so much more powerful.

    1. Of course, that’s rather the point as well, that everything in JS is so decrepit and dysfunctional that you get the weekly ‘framework/module’ that promises to Fix All Ills.

      Since it’s a prototype language, you can do an incredible amount of things with JavaScript fairly easily, but no bounds or limits also means a lot of chaos. Then you get the whole NodeJS/ECMAScript/etc. standards kerfuffle where everyone is doing their own thing, and the only thing that is certain is that something is going to explode violently on PROD.

      I did a few years of commercial (embedded) JS development, and it was very enlightening. It also made me vow to only ever touch JS again in the form of TypeScript, if only for the sake of my sanity.

Leave a Reply

Please be kind and respectful to help make the comments section excellent. (Comment Policy)

This site uses Akismet to reduce spam. Learn how your comment data is processed.