monyet.cc
  • Communities
  • Create Post
  • Create Community
  • heart
    Support Lemmy
  • search
    Search
  • Login
  • Sign Up
@kuneho@lemmy.world to Programmer Humor@programming.dev •
edit-2
2 years ago

JavaScript always know my truest of desires

lemmy.world

message-square
38
fedilink
418

JavaScript always know my truest of desires

lemmy.world

@kuneho@lemmy.world to Programmer Humor@programming.dev •
edit-2
2 years ago
message-square
38
fedilink

  • @fuck_u_spez@lemmy.fmhy.ml
    link
    fedilink
    7•2 years ago

    I couldn’t believe it, tried it out, what the actual heck? I mean I get all these weird string vs number comparison but sorting actual numbers and this comes out? What kind of drugs were the designers of javascript (or at least this function) on… Who thought it was a good idea to sort numbers lexicographically??

    • Kerb
      link
      fedilink
      3•2 years ago

      Probably meth or cocaine, considering js was written by a single person in 10 days

      • @ImpossibleRubiksCube@programming.dev
        link
        fedilink
        1•
        edit-2
        2 years ago

        deleted by creator

    • @coloredgrayscale@programming.dev
      link
      fedilink
      1•2 years ago

      That way they get to reuse the code for sorting strings!

    • @valourvalkyria@lemmy.world
      link
      fedilink
      1•2 years ago

      Iirc Array.sort requires you to pass a function in, or it casts into strings and sort them.

Programmer Humor@programming.dev

!programmer_humor@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: !programmer_humor@programming.dev

Welcome to Programmer Humor!

This is a place where you can post jokes, memes, humor, etc. related to programming!

For sharing awful code theres also Programming Horror.

Rules

  • Keep content in english
  • No advertisements
  • Posts must be related to programming or programmer topics
  • 1.82K users / day
  • 3.81K users / week
  • 8.09K users / month
  • 20K users / 6 months
  • 25K subscribers
  • 1.56K Posts
  • 58K Comments
  • Modlog
  • mods:
  • Feyter
  • adr1an
  • @BurningTurtle@programming.dev
  • Pierre-Yves Lapersonne
  • BE: 0.19.3
  • Modlog
  • Legal
  • Instances
  • Docs
  • Code
  • join-lemmy.org