Logo
There is no cloud, it's just someone else's computer.
  • Home
  • Hot
  • Random
  • Search

Browse

  • AI AI
  • AWS AWS
  • Agile Agile
  • Algorithms Algorithms
  • Android Android
  • Apple Apple
  • Azure Azure
  • Backend Backend
  • Bash Bash
  • C++ C++
  • Cloud Cloud
  • All Categories
As an Amazon Associate ProgrammerHumor.io earns from qualifying purchases.

HTTP 418: I'm a teapot

The server identifies as a teapot now and is on a tea break, brb

HTTP 418: I'm a teapot

The server identifies as a teapot now and is on a tea break, brb

Tosorted Memes

Posts tagged with Tosorted

Javascript Sorting

Javascript Programming Frontend Webdev
2 months ago 66.6M views 0 shares
Javascript Sorting
JavaScript's Array.sort() is the embodiment of "task failed successfully." It gives you a sorting method that converts numbers to strings by default (because why wouldn't you?), mutates your original array like it owns the place, and produces the legendary [1, 10, 2, 21] result that's haunted every junior dev's dreams. Then, years of Stack Overflow questions later, JavaScript blessed us with Array.toSorted() - a non-mutating version that fixes exactly ONE of the three problems. You still need to pass a comparator function like (a, b) => a - b to sort numbers properly, and the docs still use that cursed [1, 10, 2, 21] example that looks totally fine until you realize it's lexicographically sorted. The gigachad energy here is JavaScript's unwavering commitment to backwards compatibility - even when the default behavior is objectively wrong for 90% of use cases. Beautiful chaos.

Today's picks

SUNMALL Replacement Keyboard Compatible with Lenovo IBM Thinkpad E15 2019 Gen 1 20RD 20RE, E15 2020 Gen 2, E15 2021 Gen 3 Thinkpad E15 2022 Gen 4, with Pointer and Backlight

SUNMALL Replacement Keyboard Compatible with Lenovo IBM Thinkpad E15 2019 Gen 1 20RD 20RE, E15 2020 Gen 2, E15 2021 Gen 3 Thinkpad E15 2022 Gen 4, with Pointer and Backlight

Affiliate
$23.99
I don't know if this has been here yet

I don't know if this has been here yet

Programming
85.7K views 4 years ago
A beast indeed

A beast indeed

Programming
86.1K views 4 years ago