Created
April 19, 2019 03:10
-
-
Save danhab99/63b3760a40084007572c6e7217d60946 to your computer and use it in GitHub Desktop.
The worst thing ever
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const sleepsort = (arr, callback) => { | |
for (var a in arr) { | |
setTimeout((i) => callback(i), a, a); | |
} | |
} | |
let test = [39, 9, 34, 26, 3, 30, 31, 18, 21, 3, 38, 7, 13, 16, 27, 21, 18, 8, 8, 38, 2, 11, 29, 11, 22, 28, 22, 9, 12, 0, 18, 2, 30, 29, 14, 23, 27, 38, 22, 22] | |
sleepsort(test, i => console.log(i)); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment