Comment

Comment by nlco

your code can be simplified a bit:

    function sleep_sort (inputs) {
      function child (number) {
        setTimeout(function () {console.log(number)}, Math.pow(2,number))
      }

      for (var i = 0; i < inputs.length; ++i)
        child(inputs[i])
    }

    sleep_sort(process.argv.slice(2));
parent nlco 15 years ago

Discussion

Live from the official Hacker News API

A modern reader for Hacker News · SvelteKit + Skeleton