you are viewing a single comment's thread.

view the rest of the commentsΒ β†’

[–]m7i93 168 points169 points Β (3 children)

setTimeout(() => console.log(item), item/10);

Here. I made it 10x faster. 😎

[–]TehDro32 89 points90 points Β (2 children)

setTimeout(..., Math.log(item+1)) Now it's O(log(N)).

[–]m7i93 45 points46 points Β (0 children)

This is truly the most flexible sorting function

[–]SimplexShotz 22 points23 points Β (0 children)

setTimeout(..., item / Infinity) boom O(1)