Logo
Error 404: Sleep not found.
  • 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
3 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

monTEK Quad Monitor Stand Mount, Fully Adjustable Desk Mount for 4 Screen up to 17”-32” and 22lbs Capacity Each Arm, Stable Monitor Arm with C Clamp and Grommet Base, VESA 75x75mm/100x100mm

monTEK Quad Monitor Stand Mount, Fully Adjustable Desk Mount for 4 Screen up to 17”-32” and 22lbs Capacity Each Arm, Stable Monitor Arm with C Clamp and Grommet Base, VESA 75x75mm/100x100mm

Affiliate
$69.99
That's gonna hurt

That's gonna hurt

Programming
102.7K views 3 years ago
The Infinite Paradox Of Code Stealing

The Infinite Paradox Of Code Stealing

Programming
280.2K views 1 year ago