Sleep Sort JavaScript Joke
Presenting the "sleep sort", our favorite O(wtf) sorting algorithm. (C'mon, it's the weekend..) 😂 // sleep sort numbers = [8, 42, 38, 111, 2, 39, 1]; numbers.forEach(num => { setTimeout(() => { console.log(num) }, num); });
A humorous JavaScript code screenshot presents “sleep sort,” which delays printing each number by an amount equal to its value, causing the numbers to appear in sorted order by accident. The joke is that this wildly inefficient O(wtf) algorithm is offered as a weekend-friendly solution, poking fun at lazy programming and dubious sorting methods. EN: A humorous JavaScript code screenshot presents “sleep sort,” which delays printing each number by an amount equal to its value, causing the numbers to appear in sorted order by accident. The joke is that this wildly inefficient O(wtf) algorithm is offered as a weekend-friendly solution, poking fun at lazy programming and dubious sorting methods.
- @dev_meme / 1393 2020-04-26
- Type
- image
- Size
- 640×800 · 59.4 KiB
- Mood
- sarcastic, absurd
- Language
- en
- Added