921
I'll just sort it myself (sh.itjust.works)
you are viewing a single comment's thread
view the rest of the comments
[-] Armand1@lemmy.world 4 points 2 years ago

As annoying as this is, you are meant to use a comparer.

mapped.sort((a, b) => {
  if (a.value > b.value) {
    return 1;
  }
  if (a.value < b.value) {
    return -1;
  }
  return 0;
});
[-] smik@discuss.tchncs.de 5 points 2 years ago

Stuff like that exists to remind us of the Java in JavaScript

load more comments (2 replies)
this post was submitted on 05 Sep 2023
921 points (98.7% liked)

Programmer Humor

24650 readers
15 users here now

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

founded 2 years ago
MODERATORS