stackyFACTS
Technology

JavaScript sorts numbers alphabetically by default

HERE’S THE INTERESTING PART

Who needs numerical order when you can have alphabetical chaos? If you try to sort an array of numbers like 10, 2, and 1 in JavaScript without writing a custom function, it will confidently output 1, 10, 2 because it silently converts everything to text first.

JavaScript sorts numbers alphabetically by default
STACKY / Technology
One discovery leads to another.

Keep exploring facts in this topic.

Technology →
STACKY FOR IPHONE

A bigger world.
One discovery
at a time.

Keep discovering with Stacky. Interesting facts in an app that is always within reach.

Download on the App Store
ONE MORE DISCOVERY?

Keep exploring

All in this topic →
The sorting algorithm that just keeps shuffling
Technology

The sorting algorithm that just keeps shuffling

Why use intelligence when you can use pure, unadulterated chaos? Bogosort is an intentionally terrible sorting algorithm that checks if a list of numbers is…

Discover more
Sorting algorithms aggressively bubble highest values up
Technology

Sorting algorithms aggressively bubble highest values up

Bubble Sort is universally taught to coding students solely to show them how not to write an algorithm. It works by checking two adjacent numbers, swapping…

Discover more
The sorting algorithm designed never to finish
Technology

The sorting algorithm designed never to finish

Because regular Bogosort wasn't useless enough. This masterpiece of a joke algorithm actually checks if the list is sorted by running Bogosort on a copy of…

Discover more
The algorithm that sorts numbers by letting them sleep
Technology

The algorithm that sorts numbers by letting them sleep

Why do math when you can just take a nap? This unhinged algorithm sorts numbers by assigning each one a sleeper thread that pauses for that number of seconds,…

Discover more
The sorting algorithm that deletes what does not fit
Technology

The sorting algorithm that deletes what does not fit

Perfect organization is easy if you completely ignore retention rates. This brutal gag algorithm achieves perfect sequential order in a single pass simply by…

Discover more
Technology

More people now discover news from algorithmic feeds than from traditional outlets, creating echo chambers tuned to outrage; the unseen shift isn’t just what stories people read,…

Imagine standing in a vast library where every book is available—but the shelves rearrange themselves to only show titles that confirm your mood, fears, or…

Discover more
StackyMore discoveries in the app
Download on the App Store