Tom's Lemmy
  • Communities
  • Create Post
  • heart
    Support Lemmy
  • search
    Search
  • Login
  • Sign Up
Sheldan@programming.dev to Programming@programming.dev · 3 months ago

new Date("wtf")

jsdate.wtf

external-link
message-square
21
fedilink
12
external-link

new Date("wtf")

jsdate.wtf

Sheldan@programming.dev to Programming@programming.dev · 3 months ago
message-square
21
fedilink
How well do you know JavaScript's Date class?
alert-triangle
You must log in or register to comment.
  • brb@sh.itjust.works
    link
    fedilink
    arrow-up
    6
    ·
    3 months ago

    Except for some reason “2” is interpreted as a month, and the year is set to 2001.

    Aight I’m out

  • Mr. Satan@lemmy.zip
    link
    fedilink
    arrow-up
    3
    ·
    3 months ago

    I scored 10/28 on https://jsdate.wtf/ and all I got was this lousy text to share on social media.

  • catalyst@lemmy.world
    link
    fedilink
    arrow-up
    3
    ·
    3 months ago

    It only took one question for me to start wanting to flip tables.

  • FizzyOrange@programming.dev
    link
    fedilink
    arrow-up
    2
    ·
    3 months ago

    Ha this is even worse than I could have imagined!

  • thenextguy@lemmy.world
    link
    fedilink
    arrow-up
    2
    ·
    edit-2
    3 months ago

    Alright, enough making fun of languages that suck…let’s talk about JavaScript.

    https://www.destroyallsoftware.com/talks/wat

  • lunarul@lemmy.world
    link
    fedilink
    arrow-up
    2
    ·
    edit-2
    3 months ago

    If you’re not very familiar with JS, watch the Wat talk before taking the quiz to know what to expect from this wonderful language.

    • Lemminary@lemmy.world
      link
      fedilink
      arrow-up
      1
      ·
      3 months ago

      And then promptly get yourself familiar with how the language actually works. https://github.com/getify/You-Dont-Know-JS

      People who complain about JS often assume it has features of other languages and fail to realize it has its own architecture and winding history.

  • bleistift2@sopuli.xyz
    link
    fedilink
    English
    arrow-up
    1
    ·
    3 months ago

    I am a frontend dev. JavaScript (well, TypeScript) is my bread and butter. Even knowing its quirks I never would have thought how inconsistent Date actually is. I encourage everyone to try this quiz.

    This is what JavaScript haters should bring forth, not 0.1 + 0.2 !== 0.3!

    • Tanoh@lemmy.world
      link
      fedilink
      arrow-up
      0
      ·
      3 months ago

      There is a reason almost everyone use some Date lib, like Luxon and not the built in. And well, having a horrible built in lib that they can’t change due to legacy code breaking is nothing really new or unique to JS.

      • bleistift2@sopuli.xyz
        link
        fedilink
        English
        arrow-up
        1
        ·
        3 months ago

        The built-in lib is fine for basic stuff unless you do some crazy shit like expecting "2" to parse as a valid date.

  • DrWorm@piefed.social
    link
    fedilink
    English
    arrow-up
    1
    ·
    3 months ago

    The quirks in this quiz aren’t even universal, and vary based on which browser you’re using. See the table at https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/parse#non-standard_date_strings

    Also I got 13/28 😑

  • tatterdemalion@programming.dev
    link
    fedilink
    arrow-up
    1
    ·
    3 months ago

    Can we start a new web with a better language/platform already?

    • FooBarrington@lemmy.world
      link
      fedilink
      arrow-up
      0
      ·
      3 months ago

      Why? Why not improve JS (e.g. with Temporal), especially given how excellent Typescript is?

      • tatterdemalion@programming.dev
        link
        fedilink
        arrow-up
        1
        ·
        3 months ago

        JS is a lost cause.

      • Sheldan@programming.devOP
        link
        fedilink
        arrow-up
        0
        ·
        3 months ago

        I wouldn’t call typescript excellent, if I did it would be on a very low standard.

        • FooBarrington@lemmy.world
          link
          fedilink
          arrow-up
          1
          ·
          3 months ago

          It unquestionably is excellent. Can you name another language in common use with a type system that’s close to the expressiveness of Typescript?

  • humanspiral@lemmy.ca
    link
    fedilink
    arrow-up
    1
    ·
    3 months ago

    Can we sue Oracle back for any of this?

    • BatmanAoD@programming.dev
      link
      fedilink
      arrow-up
      0
      ·
      3 months ago

      Oracle? Oracle owns Java, not JavaScript.

      • humanspiral@lemmy.ca
        link
        fedilink
        arrow-up
        1
        ·
        3 months ago

        They ended up with Javascript trademark (afaik, because the name was too close to Java) too. Sued node.js over something related.

  • fubarx@lemmy.world
    link
    fedilink
    arrow-up
    1
    ·
    3 months ago

    9/28. WTF’ing through 90% of the questions.

  • Macallan@lemmy.world
    link
    fedilink
    English
    arrow-up
    0
    ·
    3 months ago

    I got a 4/28 and got told I would have scored higher if I guessed at random. Ouch. (I am not a dev)

Programming@programming.dev

programming@programming.dev

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: [email protected]

Welcome to the main community in programming.dev! Feel free to post anything relating to programming here!

Cross posting is strongly encouraged in the instance. If you feel your post or another person’s post makes sense in another community cross post into it.

Hope you enjoy the instance!

Rules

Rules

  • Follow the programming.dev instance rules
  • Keep content related to programming in some way
  • If you’re posting long videos try to add in some form of tldr for those who don’t want to watch videos

Wormhole

Follow the wormhole through a path of communities [email protected]



Visibility: Public
globe

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

  • 150 users / day
  • 1.16K users / week
  • 1.45K users / month
  • 5.64K users / 6 months
  • 1 local subscriber
  • 23K subscribers
  • 643 Posts
  • 5.4K Comments
  • Modlog
  • mods:
  • snowe@programming.dev
  • Ategon@programming.dev
  • MaungaHikoi@lemmy.nz
  • UlrikHD@programming.dev
  • BE: 0.19.9
  • Modlog
  • Instances
  • Docs
  • Code
  • join-lemmy.org