JavaScript Sorting Surprise
I want to learn JavaScript > [10, 9, 8, 3, 2, 1, 0].sort() [0, 1, 10, 2, 3, 8, 9]
A medieval monk appears to be teaching a lion, with speech bubbles showing someone learning JavaScript and discovering that the default sort produces the lexicographic order [0, 1, 10, 2, 3, 8, 9]. The joke is that JavaScript sorts numbers as strings unless a comparison function is provided, making this a reaction image for confusing or frustrating programming behavior.
- @profunctor_io / 982 2018-06-21
- Type
- image
- Size
- 800×800 · 178.6 KiB
- Mood
- confused, absurd
- Language
- en
- Added