memesearch
JavaScript Array Sorting Itself

JavaScript Array Sorting Itself

Download Find similar pictures
Text on the meme
index.html style.css script.js const arr = [20, 5, 100,1, 90, 200, 40, 29]; for(let item of arr){ setTimeout(() => console.log(item), item) } CONSOLE 1 5 20 29 40 90 100 200
What it means

A JavaScript editor shows an array being processed with setTimeout, while the console prints the values in ascending order rather than their original order. The joke is that asynchronous callbacks with numeric delays make the numbers appear sorted by execution time, creating a surprisingly satisfying result for a programmer. EN: A JavaScript editor shows an array being processed with setTimeout, while the console prints the values in ascending order rather than their original order. The joke is that asynchronous callbacks with numeric delays make the numbers appear sorted by execution time, creating a surprisingly satisfying result for a programmer.

Objects
Tags
Source
Type
image
Size
800×755 · 34.0 KiB
Mood
satisfying, nerdy
Language
en
Added