Logo
In case of fire: git commit, git push, leave building.
  • 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

Mutation Memes

Posts tagged with Mutation

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

Beelink Mini PC, SER5 AMD Ryzen 5 5500U(7nm, 6C/12T) up to 4.0GHz | Mini Computer 16GB DDR4 RAM 480GB NVME SSD, Micro PC 4K@60Hz Dual Display, WiFi6/BT5.2/HTPC/W-11 Pro

Beelink Mini PC, SER5 AMD Ryzen 5 5500U(7nm, 6C/12T) up to 4.0GHz | Mini Computer 16GB DDR4 RAM 480GB NVME SSD, Micro PC 4K@60Hz Dual Display, WiFi6/BT5.2/HTPC/W-11 Pro

Affiliate
$389.00
Self Lgtm

Self Lgtm

Git
24.6M views 2 months ago
Well

Well

Programming
91.4K views 3 years ago