Created
June 10, 2016 01:57
-
-
Save Xpktro/3f86d60f1ecca00df76bec42e7b8579a to your computer and use it in GitHub Desktop.
Sleep Sort in JS
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
function sleepsort(numbers) { | |
numbers.forEach(function(number) { | |
setTimeout(function(){console.log(number)}, number) | |
}) | |
} | |
sleepsort([2, 1, 3, 4, 6, 5, 7]) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment