100
timeoutSort (lemmy.ml)
submitted 6 months ago by yogthos@lemmy.ml to c/programmerhumor@lemmy.ml
you are viewing a single comment's thread
view the rest of the comments
[-] Vinapocalypse@lemmy.ml 4 points 6 months ago* (last edited 6 months ago)

PR:

-  setTimeout(() => console.log(item), item)
+  setTimeout(() => console.log(item), Math.log(item))

Comment: This will speed up sort time greatly. However, sort order may become erratic for longer lists, and lists with numbers less than 1

this post was submitted on 04 Nov 2025
100 points (99.0% liked)

Programmer Humor

42202 readers
430 users here now

Post funny things about programming here! (Or just rant about your favourite programming language.)

Rules:

founded 6 years ago
MODERATORS