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.
Wow, I’m only half way through the quiz and yeah, it’s 100% garbage.
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???
A date in UTC+1 would be substracted by 1 hour in UTC
the best part is none of this behaviour is in the actual JS standard, everything except parsing a simplified ISO 8601 datetime string is implementation-defined
https://tc39.es/ecma262/multipage/numbers-and-dates.html#sec-date.parse
In fact half of the questions give a different result in Firefox than what shown in the video.
Honourable mention of:
https://wtfjs.com/
And:
https://www.wooji-juice.com/blog/javascript-article.html
Which includes this quote:
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
What’s that +01 nonsense? Just get rid of time zones, and run everything off GMT!
Ah , a Flat Earther!
:)
Let him run circles, but tethered, to prevent falling.
Must have used JS to calculate publication date for this article. Missed 2025-04-01 by … Damn, how do you use JS date???
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.
could try sending Date() a date in a format it likes, see if that works
“I scored 10/28 on https://jsdate.wtf and all I got was this lousy text to share on social media.”
That’s one messy parser…
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.
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.
JavaScript really needs support for operator overload so we can actually make sensible libraries