Ranter
Join devRant
Do all the things like
++ or -- rants, post your own rants, comment on others' rants and build your customized dev avatar
Sign Up
Pipeless API
From the creators of devRant, Pipeless lets you power real-time personalized recommendations and activity feeds using a simple API
Learn More
Comments
-
@kamen it travels to the past. So by the time you execute the program, the numbers will be already sorted.
-
Using the array.forEach method to generate an even shittier version of array.sort.
Nuke them. Burn it all. -
Crost41084yAin't no one else focused on the fact that this will cause a macro task to be added for each array item? Meaning the time to process this could be delayed for no reason by a different task.
-
Oh this is pure gold.
I mean it’s shit, won’t work for negatives, and of course will take as long as the sum of the numbers (in ms) to complete, but I still love it.
It’s like the Rain Man of array sorts. -
@iiii Oh, yup, you're right...
It would just be the largest number plus enough time to process the foreach loop because all the setTimouts would essentially run concurrently, my mistake.
Came across this sorting function in JS, should it be allowed?
random
javascript
wonders