142
submitted 2 weeks ago by tfm@europe.pub to c/programmerhumor@lemmy.ml

cross-posted from: https://programming.dev/post/33754840

new Date("wtf")

you are viewing a single comment's thread
view the rest of the comments
[-] kinttach@lemmy.zip 20 points 2 weeks ago* (last edited 2 weeks ago)

In the process of being replaced.

https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Temporal

JavaScript has had the Date object for handling date and time since its first days. However, the Date API is based on the poorly designed java.util.Date class from Java, which was replaced in the early 2010s; but, because of JavaScript's goal of backward compatibility, Date sticks around in the language.

[-] sp3ctr4l@lemmy.dbzer0.com 17 points 2 weeks ago

Damn, I thought you meant JavaScript itself was being replaced.

[-] jimi_henrik@lemmy.world 15 points 2 weeks ago

One can only undefined

[-] Ephera@lemmy.ml 6 points 2 weeks ago

Hmm, I can believe that it was based on java.util.Date, but I don't remember that being as unpredictable. I guess, a different API to begin with, would have avoided a lot of problems, though...

this post was submitted on 12 Jul 2025
142 points (100.0% liked)

Programmer Humor

37475 readers
15 users here now

Post funny things about programming here! (Or just rant about your favourite programming language.)

Rules:

founded 6 years ago
MODERATORS