Skip to content

Instantly share code, notes, and snippets.

@GabrielModog
Created December 13, 2024 08:43
Show Gist options
  • Save GabrielModog/a7c90213870e1c911c091d6f76d2b519 to your computer and use it in GitHub Desktop.
Save GabrielModog/a7c90213870e1c911c091d6f76d2b519 to your computer and use it in GitHub Desktop.

Revisions

  1. GabrielModog created this gist Dec 13, 2024.
    4 changes: 4 additions & 0 deletions sleep-sort.js
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,4 @@
    const arr = [5, 4, 1, 2, 8, 10]
    arr.forEach(num => {
    setTimeout(() => console.log(item), num * 0.5)
    })