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

JavaScript is awesome

jsdate.wtf

external-link
message-square
7
link
fedilink
  • cross-posted to:
  • programmer_humor@programming.dev
  • programming@programming.dev
2
external-link

JavaScript is awesome

jsdate.wtf

tfm@europe.pub to Programmer Humor@lemmy.ml · 1 month ago
message-square
7
link
fedilink
  • cross-posted to:
  • programmer_humor@programming.dev
  • 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”)

alert-triangle
You must log in or register to comment.
  • AnarchistArtificer@slrpnk.net
    link
    fedilink
    English
    arrow-up
    1
    ·
    1 month ago

    This quiz was stressful. Like, there were so many times when I knew I was being cued up for a trick question, but I still fell for it.

  • Godnroc@lemmy.world
    link
    fedilink
    English
    arrow-up
    1
    ·
    1 month ago

    Best laugh I’ve had in a while. That is some grade-A jank.

  • kinttach@lemmy.zip
    link
    fedilink
    arrow-up
    0
    ·
    edit-2
    1 month 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
      1
      ·
      1 month ago

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

  • mogoh@lemmy.ml
    link
    fedilink
    arrow-up
    0
    ·
    1 month ago

    Ok, I get that the Date API is problematic, but I wouldn’t expect anything meaningfull from new Date("not a date").getTime() anyway. Why would you in the first place?

    • blaue_Fledermaus@mstdn.io
      link
      fedilink
      arrow-up
      0
      ·
      1 month ago

      Parsing user input? Nonsense data coming from an API?

      • pixely@lemmy.world
        link
        fedilink
        arrow-up
        0
        ·
        edit-2
        1 month ago

        If you’re expecting shit data then you’d have unit tests for those cases so you’d know what to expect.

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.

  • 55 users / day
  • 445 users / week
  • 3.61K users / month
  • 3.66K users / 6 months
  • 2 local subscribers
  • 37.9K subscribers
  • 1.29K Posts
  • 14.7K Comments
  • Modlog
  • mods:
  • AgreeableLandscape@lemmy.ml
  • cat_programmer@lemmy.ml
  • UI: unknown version
  • BE: 0.19.11
  • Modlog
  • Instances
  • Docs
  • Code
  • join-lemmy.org