NerdHouse Social
  • Communities
  • Create Post
  • Create Community
  • heart
    Support Lemmy
  • search
    Search
  • Login
  • Sign Up
tfm@europe.pub to Programmer Humor@lemmy.ml · 1 day ago

JavaScript is awesome

jsdate.wtf

external-link
message-square
22
fedilink
  • cross-posted to:
  • programming@programming.dev
130
external-link

JavaScript is awesome

jsdate.wtf

tfm@europe.pub to Programmer Humor@lemmy.ml · 1 day ago
message-square
22
fedilink
  • cross-posted to:
  • programming@programming.dev
new Date("wtf")
jsdate.wtf
external-link
How well do you know JavaScript's Date class?

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

new Date(“wtf”)

  • kinttach@lemmy.zip
    link
    fedilink
    arrow-up
    17
    ·
    edit-2
    24 hours 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
      link
      fedilink
      English
      arrow-up
      13
      ·
      21 hours ago

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

      • jimi_henrik@lemmy.world
        link
        fedilink
        arrow-up
        13
        ·
        20 hours ago

        One can only undefined

    • Ephera@lemmy.ml
      link
      fedilink
      English
      arrow-up
      6
      ·
      21 hours 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…

Programmer Humor@lemmy.ml

programmerhumor@lemmy.ml

Subscribe from Remote Instance

Create a post
You are not logged in. However you can subscribe from another Fediverse account, for example Lemmy or Mastodon. To do this, paste the following into the search field of your instance: !programmerhumor@lemmy.ml

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

Rules:

  • Posts must be relevant to programming, programmers, or computer science.
  • No NSFW content.
  • Jokes must be in good taste. No hate speech, bigotry, etc.
Visibility: Public
globe

This community can be federated to other instances and be posted/commented in by their users.

  • 363 users / day
  • 866 users / week
  • 2.8K users / month
  • 9.93K users / 6 months
  • 1 local subscriber
  • 37.2K subscribers
  • 1.82K Posts
  • 38.6K Comments
  • Modlog
  • mods:
  • AgreeableLandscape@lemmy.ml
  • cat_programmer@lemmy.ml
  • UI: 0.19.7
  • BE: 0.19.11
  • Modlog
  • Instances
  • Docs
  • Code
  • join-lemmy.org